Travis build: 1196

This commit is contained in:
30secondsofcode
2018-01-11 19:20:57 +00:00
parent 7c90851e90
commit 0fc59a817c
5 changed files with 85 additions and 6 deletions

View File

@ -5,8 +5,7 @@ Returns an array of function property names from own enumerable properties of ob
Use `Object.keys(obj)` to iterate over the object's own properties, `Array.filter()` to keep only those that are functions.
```js
const functions = obj =>
Object.keys(obj).filter(key => typeof obj[key] === 'function');
const functions = obj => Object.keys(obj).filter(key => typeof obj[key] === 'function');
```
```js
@ -14,5 +13,5 @@ function Foo() {
this.a = () => 1;
this.b = () => 2;
}
functions(new Foo); // ['a', 'b']
functions(new Foo()); // ['a', 'b']
```