GuardsisPrimitiveisPrimitive CallableisPrimitive(x: unknown): x is boolean | PropertyKeyChecks if x is a primitive. ExampleisPrimitive(1234)// => trueisPrimitive(12.34)// => trueisPrimitive("foobar")// => trueisPrimitive({})// => false@deprecatedHard to find a use case for this function.Parametersx: unknownThe value to check.Returns x is boolean | PropertyKeytrue if x is a primitive, false otherwise.
Checks if
x
is a primitive.Example
Hard to find a use case for this function.