Last active
September 5, 2019 07:37
-
-
Save andrewlistopadov/f6bc83d12ce151f5f0bc25c7c7443c89 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const arr = [{name: 'Bill', age: 26}, {name: 'Sara', age: 42}, {name: 'Tom', age: 13}]; | |
| const namesArray = arr.map(({age, ...keepAttrs}) => keepAttrs); // removes `age` | |
| console.log(namesArray); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment