Update descriptions of some older type snippets

This commit is contained in:
Angelos Chalaris
2020-03-05 23:06:26 +02:00
parent 0260fc759e
commit 69db3851ff
4 changed files with 9 additions and 8 deletions

View File

@ -5,7 +5,8 @@ tags: type,beginner
Returns the native type of a value.
Returns lowercased constructor name of value, `"undefined"` or `"null"` if value is `undefined` or `null`.
Return `"undefined"` or `"null"` if the value is `undefined` or `null`.
Otherwise, use `Object.prototype.constructor.name` to get the name of the constructor, `String.prototype.toLowerCase()` to return it in lowercase.
```js
const getType = v =>
@ -14,4 +15,4 @@ const getType = v =>
```js
getType(new Set([1, 2, 3])); // 'set'
```
```