npm.io
0.0.5 • Published 8 years ago

is-primitive-type

Licence
MIT
Version
0.0.5
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
1

is-primitive

A primitive is data that is not an object and has no methods.

is-primitive is a JavaScript method that allows determine if a datatype is primitive or not.

JavaScript has 6 primitive datatypes:

  • String
  • Number
  • Null
  • Undefined
  • Boolean
  • Symbol

More information about JavaScript Primitive Types

How to install

npm install is-primitive-type
How to test
npm run test
Usage
var isPrimitive = require('is-primitive-type');

isPrimitive(null);
// returns true

isPrimitive([1, 2, 3]);
// returns false

isPrimitive({ a: 1, b: 2, c: 3 });
// returns false

Keywords