diff --git a/snippets/getType.md b/snippets/getType.md index 381df31c3..da4b259c7 100644 --- a/snippets/getType.md +++ b/snippets/getType.md @@ -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' -``` \ No newline at end of file +``` diff --git a/snippets/isNil.md b/snippets/isNil.md index c8ed1cbb2..8d7520991 100644 --- a/snippets/isNil.md +++ b/snippets/isNil.md @@ -5,7 +5,7 @@ tags: type,beginner Returns `true` if the specified value is `null` or `undefined`, `false` otherwise. -Use the strict equality operator to check if the value and of `val` are equal to `null` or `undefined`. +Use the strict equality operator to check if the value of `val` is equal to `null` or `undefined`. ```js const isNil = val => val === undefined || val === null; @@ -14,4 +14,4 @@ const isNil = val => val === undefined || val === null; ```js isNil(null); // true isNil(undefined); // true -``` \ No newline at end of file +``` diff --git a/snippets/isNull.md b/snippets/isNull.md index ba9495124..ec3065d06 100644 --- a/snippets/isNull.md +++ b/snippets/isNull.md @@ -5,7 +5,7 @@ tags: type,beginner Returns `true` if the specified value is `null`, `false` otherwise. -Use the strict equality operator to check if the value and of `val` are equal to `null`. +Use the strict equality operator to check if the value of `val` is equal to `null`. ```js const isNull = val => val === null; @@ -13,4 +13,4 @@ const isNull = val => val === null; ```js isNull(null); // true -``` \ No newline at end of file +``` diff --git a/snippets/isUndefined.md b/snippets/isUndefined.md index d6e09916b..112e66285 100644 --- a/snippets/isUndefined.md +++ b/snippets/isUndefined.md @@ -5,7 +5,7 @@ tags: type,beginner Returns `true` if the specified value is `undefined`, `false` otherwise. -Use the strict equality operator to check if the value and of `val` are equal to `undefined`. +Use the strict equality operator to check if `val` is equal to `undefined`. ```js const isUndefined = val => val === undefined; @@ -13,4 +13,4 @@ const isUndefined = val => val === undefined; ```js isUndefined(undefined); // true -``` \ No newline at end of file +```