Skip to content

Instantly share code, notes, and snippets.

View natchanon37's full-sized avatar
🏠
Working from home

NATCHANON natchanon37

🏠
Working from home
View GitHub Profile
@natchanon37
natchanon37 / destructuring.js
Created February 8, 2023 01:31 — forked from mikaelbr/destructuring.js
Complete collection of JavaScript 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];