Classify
classify
RESCRIPT
let classify: 'a => tclassify(anyValue)
Classifies a JavaScript value.
Examples
RESCRIPTswitch %raw(`null`)->Type.Classify.classify {
| Null => Console.log("Yup, that's null.")
| _ => Console.log("This doesn't actually appear to be null...")
}
function
RESCRIPT
type functionAn abstract type representing a JavaScript function.
See function on MDN.
object
RESCRIPT
type objectAn 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(Symbol.t)
| BigInt(bigint)The type representing a classified JavaScript value.