Skip to content

Instantly share code, notes, and snippets.

@andrewlistopadov
Last active September 5, 2019 07:37
Show Gist options
  • Select an option

  • Save andrewlistopadov/f6bc83d12ce151f5f0bc25c7c7443c89 to your computer and use it in GitHub Desktop.

Select an option

Save andrewlistopadov/f6bc83d12ce151f5f0bc25c7c7443c89 to your computer and use it in GitHub Desktop.

Revisions

  1. andrewlistopadov renamed this gist Sep 5, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. andrewlistopadov created this gist Sep 5, 2019.
    4 changes: 4 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    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);