0.0.2 • Published 9 years ago

get-object-type v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

get-object-type

NPM version Build Status Code Climate Coverage Status Dependency Status devDependency Status

NPM

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.