better type checking
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.travis.yml
History.md
Makefile
Readme.md
component.json
index.js
package.json
test.js

Readme.md

typedof

better type checking

install

node

$ npm install typedof

component

$ component install jwerle/typedof

bower

$ bower install typedof

api

typedof(i)

returns the type of a given input

assert('string' === typedof('string'));
assert('boolean' === typedof(true));
assert('number' === typedof(0));
assert('date' === typedof(new Date));
assert('null' === typedof(null));
assert('undefined' === typedof(undefined));
assert('function' === typedof(function(){}));
assert('array' === typedof([]));
assert('regexp' === typedof(/foo/));
assert('object' === typedof({}));
assert('nan' === typedof(NaN));

license

MIT