gleam/javascript

Types

Symbols are special unique values in JavaScript.

For further information view the MDN documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol

pub type Symbol

The variants that type_of can return.

pub type TypeOf {
  UndefinedType
  ObjectType
  BooleanType
  NumberType
  BigIntType
  StringType
  SymbolType
  FunctionType
}

Constructors

  • UndefinedType

    It is the value undefined.

  • ObjectType

    It is some object, or it is null.

  • BooleanType

    It is either true or false.

  • NumberType

    It is some number, a 64 bit float.

  • BigIntType

    It is a JavaScript big-integer.

  • StringType

    It is a string.

  • SymbolType

    It is a JavaScript symbol.

  • FunctionType

    It is a function of unknown argument types and return type.

Functions

pub fn get_symbol(a: String) -> Symbol

Use the JavaScript Symbol.for method to look up a symbol with the given string name, creating a new one if one does exist.

For further information see the MDN documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/for

pub fn type_of(a: a) -> TypeOf

Determine what category of JavaScript type a value belongs to.

This uses the JavaScript typeof operator and has limited accuracy. It cannot tell you anything about what Gleam type a value has.

For further information view the MDN documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol

Search Document