obj-type

1.0.1 • Public • Published

obj-type Build Status

Returns any kind of object's type.

Regexp, array, etc. are objects in JavaScript.

Install

$ npm install --save obj-type

Usage

var objType = require('obj-type');
 
objType({foo: 'bar'});
//=> 'object'
 
objType(/foo/);
//=> 'regexp'
 
objType(['foo', 'bar']);
//=> 'array'
 
objType(new Date());
//=> 'date'
 
objType(null);
//=> 'null'

License

MIT © Andreas Gillström

Package Sidebar

Install

npm i obj-type

Weekly Downloads

386

Version

1.0.1

License

MIT

Last publish

Collaborators

  • gillstrom