is-primitive-x
v1.0.1
Published
Returns true if the value is a primitive.
Downloads
5,974
Maintainers
Readme
is-primitive-x
Returns true if the value is a primitive.
module.exports
⇒ * ⏏
Returns true if the value is a primitive.
Kind: Exported member
Returns: * - The value to test.
| Param | Type | Description | | ----- | --------------- | ------------------ | | [val] | * | The value to test. |
Example
import isPrimitive from 'is-primitive-x';
console.log(isPrimitive()); // true
console.log(isPrimitive(42)); // true
console.log(isPrimitive('abc')); // true
console.log(isPrimitive(Symbol())); // true
console.log(isPrimitive({})); // false
console.log(isPrimitive([])); // false
console.log(isPrimitive(function() {})); // false
console.log(isPrimitive(new Date())); // false