Skip to content

isPrimitive

Yousif Al-Raheem edited this page Apr 15, 2020 · 1 revision

This utility checks if a value is of primitive type (string, number, or boolean).

Example

console.log(isPrimitive("hello world"); // true
console.log(isPrimitive(["hello world"]); // false

Properties

Param Type Description
value any The value that needs to be checked
Clone this wiki locally