0.0.2 • Published 9 years ago
get-object-type v0.0.2
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.