Travis build: 1196
This commit is contained in:
@ -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']
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user