Skip to content

kownacki/true-typeof

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM

Build Status Greenkeeper badge

true-typeof

Get correct type of value as specified in ECMAScript specification about language types http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values

Installation

$ npm install true-typeof

API

var trueTypeof = require("true-typeof");
trueTypeof(value); // → type
  • value - Any value. Object or primitive.

Returns a string with correct JavaScript language type.

Examples:

trueTypeof(null); // → "null"
trueTypeof(function() {}); // → "object"

For values other that null and functions it works exactly like standard typeof.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published