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

@ -28,6 +28,7 @@
* [Flatten array](#flatten-array) * [Flatten array](#flatten-array)
* [Get max value from array](#get-max-value-from-array) * [Get max value from array](#get-max-value-from-array)
* [Get min value from array](#get-min-value-from-array) * [Get min value from array](#get-min-value-from-array)
* [Get native type of value](#get-native-type-of-value)
* [Get scroll position](#get-scroll-position) * [Get scroll position](#get-scroll-position)
* [Greatest common divisor (GCD)](#greatest-common-divisor-gcd) * [Greatest common divisor (GCD)](#greatest-common-divisor-gcd)
* [Head of list](#head-of-list) * [Head of list](#head-of-list)
@ -267,7 +268,8 @@ const arrayMin = arr => Math.min(...arr);
Returns lower-cased constructor name of value, "undefined" or "null" if value is undefined or null Returns lower-cased constructor name of value, "undefined" or "null" if value is undefined or null
```js ```js
const getType = v => v === undefined ? "undefined" : v === null ? "null" : v.constructor.name.toLowerCase(); const getType = v =>
v === undefined ? "undefined" : v === null ? "null" : v.constructor.name.toLowerCase();
// getType(new Set([1,2,3])) -> "set" // getType(new Set([1,2,3])) -> "set"
``` ```

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"
```