Skip to content

Instantly share code, notes, and snippets.

@MidasXIV
Created October 22, 2019 05:20
Show Gist options
  • Save MidasXIV/aedf2e178955330713a9d66d2d7d1aaf to your computer and use it in GitHub Desktop.
Save MidasXIV/aedf2e178955330713a9d66d2d7d1aaf to your computer and use it in GitHub Desktop.

Revisions

  1. MidasXIV created this gist Oct 22, 2019.
    8 changes: 8 additions & 0 deletions array_object_difference_destructuring.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    let arr = [10, 20];
    let one, two;
    [one, two] = arr;
    console.log(`${one} ${two}`);
    let obj = { prop1: 'mxiv', prop2: 'UAE' };
    let name, location;
    ({ prop1: name, prop2: location } = obj);
    console.log(`${name} ${location}`);