$ npm install 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
© 2010 - cnpmjs.org x YWFE | Home | YWFE