Skip to content

Instantly share code, notes, and snippets.

@andrewlistopadov
Last active September 5, 2019 07:37
Show Gist options
  • Save andrewlistopadov/f6bc83d12ce151f5f0bc25c7c7443c89 to your computer and use it in GitHub Desktop.
Save andrewlistopadov/f6bc83d12ce151f5f0bc25c7c7443c89 to your computer and use it in GitHub Desktop.
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