is-primitive-type

0.0.5 • Public • Published

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

/is-primitive-type/

    Package Sidebar

    Install

    npm i is-primitive-type

    Weekly Downloads

    1

    Version

    0.0.5

    License

    MIT

    Unpacked Size

    4.48 kB

    Total Files

    6

    Last publish

    Collaborators

    • fesebuv