obj-type

Returns any kind of object's type.

Usage no npm install needed!

<script type="module">
  import objType from 'https://cdn.skypack.dev/obj-type';
</script>

README

obj-type Build Status

Returns any kind of object's type.

Regexp, array, etc. are objects in JavaScript.

Install

$ npm install --save obj-type

Usage

var objType = require('obj-type');

objType({foo: 'bar'});
//=> 'object'

objType(/foo/);
//=> 'regexp'

objType(['foo', 'bar']);
//=> 'array'

objType(new Date());
//=> 'date'

objType(null);
//=> 'null'

License

MIT © Andreas Gillström