Build README

This commit is contained in:
Angelos Chalaris
2017-12-13 11:32:52 +02:00
parent 33ff5064e2
commit e330ff3f8f
2 changed files with 12 additions and 1 deletions

View File

@ -0,0 +1,9 @@
### Get native type of value
Returns lower-cased constructor name of value, "undefined" or "null" if value is undefined or null
```js
const getType = v =>
v === undefined ? "undefined" : v === null ? "null" : v.constructor.name.toLowerCase();
// getType(new Set([1,2,3])) -> "set"
```