Documentation
API
Common

Common

Functions that work on many different types of values. Also see the experimental JSON functions.

equal

Returns true if the two values passed in are equal, false otherwise. Does not work for Squiggle functions, but works for most other types.

infix: ==
Namespace optional
Signatures
Common.equal(any, any) => Bool

unequal

infix: !=
Namespace optional
Signatures
Common.unequal(any, any) => Bool

typeOf

Returns the type of the value passed in as a string. This is useful when you want to treat a value differently depending on its type.

Namespace optional
Signatures
Common.typeOf(any) => String
Examples

inspect

Runs Console.log() in the Javascript developer console (opens in a new tab) and returns the value passed in.

Namespace optional
Signatures
Common.inspect('A, message?: String?) => 'A

throw

Throws a fatal error. There is no way in the language to catch this error.

Namespace optional
Signatures
Common.throw(message: String?) => any