get-object-type
v0.0.2
Published
get the type of a javascript object.
Downloads
16
Maintainers
Readme
get-object-type
Description
get the type of a javascript object as a string. an alternative to using typeof checks.
NOTE: I've re-written / used this function so many different times, I decided to publish it as a module.
Getting Started
Install the module with: npm install get-object-type
var getType = require('get-object-type');
getType(null); // returns 'Null'
getType([]); // returns 'Array'
getType({foo: 'bar'}); // returns 'Object'
getType(42); // returns 'Number'
License
Copyright (c) 2014 skratchdot
Licensed under the MIT license.