Skip to content

Instantly share code, notes, and snippets.

View alvinyen's full-sized avatar

Alvin alvinyen

  • Taipei City, Taiwan
View GitHub Profile
@alvinyen
alvinyen / destructuring.js
Created March 5, 2017 14:33 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];