Update descriptions of some older type snippets
This commit is contained in:
@ -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'
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user