Skip to content

env: isVariable()

Eugene Lazutkin edited this page Jan 11, 2022 · 1 revision

This function is used to determine if an object is of Variable class. It is used internally by unify().

isVariable() is defined in env and can be accessed like that:

import {isVariable} from 'deep6/env.js';

The current implementation:

const isVariable = x => x instanceof Variable;

Example of use:

import {isVariable, variable} from 'deep6/env.js';

const x = variable();

isVariable(x); // true
isVariable(1); // false
Clone this wiki locally