Travis build: 1183

This commit is contained in:
30secondsofcode
2018-01-11 10:40:53 +00:00
parent bb1ccffea7
commit 967df5f670
4 changed files with 41 additions and 2 deletions

View File

@ -314,6 +314,7 @@ average(1, 2, 3);
* [`isFunction`](#isfunction) * [`isFunction`](#isfunction)
* [`isNull`](#isnull) * [`isNull`](#isnull)
* [`isNumber`](#isnumber) * [`isNumber`](#isnumber)
* [`isObject`](#isobject)
* [`isPrimitive`](#isprimitive) * [`isPrimitive`](#isprimitive)
* [`isPromiseLike`](#ispromiselike) * [`isPromiseLike`](#ispromiselike)
* [`isString`](#isstring) * [`isString`](#isstring)
@ -4893,6 +4894,34 @@ isNumber(1); // true
<br>[⬆ Back to top](#table-of-contents) <br>[⬆ Back to top](#table-of-contents)
### isObject
Returns a boolean determining if the passed value is an object or not.
Uses the `Object` constructor to create an object wrapper for the given value.
If the value is `null` or `undefined`, create and return an empty object. Οtherwise, return an object of a type that corresponds to the given value.
```js
const isObject = obj => obj === Object(obj);
```
<details>
<summary>Examples</summary>
```js
isObject([1, 2, 3, 4]); // true
isObject([]); // true
isObject(['Hello!']); // true
isObject({ a: 1 }); // true
isObject({}); // true
isObject(true); // false
```
</details>
<br>[⬆ Back to top](#table-of-contents)
### isPrimitive ### isPrimitive
Returns a boolean determining if the passed value is primitive or not. Returns a boolean determining if the passed value is primitive or not.
@ -5272,6 +5301,7 @@ const httpPost = (url, callback, data = null, err = console.error) => {
const newPost = { const newPost = {
"userId": 1, "userId": 1,
"id": 1337, "id": 1337,

File diff suppressed because one or more lines are too long

View File

@ -30,6 +30,7 @@ const httpPost = (url, callback, data = null, err = console.error) => {
const newPost = { const newPost = {
"userId": 1, "userId": 1,
"id": 1337, "id": 1337,

View File

@ -13,7 +13,7 @@ const isObject = obj => obj === Object(obj);
isObject([1, 2, 3, 4]); // true isObject([1, 2, 3, 4]); // true
isObject([]); // true isObject([]); // true
isObject(['Hello!']); // true isObject(['Hello!']); // true
isObject({ a:1 }); // true isObject({ a: 1 }); // true
isObject({}); // true isObject({}); // true
isObject(true); // false isObject(true); // false
``` ```