added isObject snippet

This commit is contained in:
King
2018-01-11 05:24:06 -05:00
parent f93efa9f58
commit 5665d4792a

16
snippets/isObject.md Normal file
View File

@ -0,0 +1,16 @@
### isObject
Returns a boolean determining if the passed value is an object or not.
```js
const isObject = obj => obj === Object(obj);
```
```js
isObject([1, 2, 3, 4]); // true
isObject([]); // true
isObject(['Hello!']); // true
isObject({ a:1 }); // true
isObject({}); // true
isObject(true); // false
```