API / Core / Type / Classify

Classify

function

RESCRIPT
type function

An abstract type representing a JavaScript function.

See function on MDN.

object

RESCRIPT
type object

An abstract type representing a JavaScript object.

See object on MDN.

t

RESCRIPT
type t = | Bool(bool) | Null | Undefined | String(string) | Number(float) | Object(object) | Function(function) | Symbol(Core__Symbol.t) | BigInt(Core__BigInt.t)

The type representing a classified JavaScript value.

classify

RESCRIPT
let classify: 'a => t

classify(anyValue) Classifies a JavaScript value.

Examples

RESCRIPT
switch %raw(`null`)->Type.Classify.classify { | Null => Console.log("Yup, that's null.") | _ => Console.log("This doesn't actually appear to be null...") }