Skip to content

Instantly share code, notes, and snippets.

View 3ndrius's full-sized avatar
🎯
Focusing

Andrzej 3ndrius

🎯
Focusing
View GitHub Profile
@yang-wei
yang-wei / README.md
Last active April 6, 2021 15:49
ES6 destructing (and rest parameter)

We will first discussed how destructing and rest parameters can be used in ES6 - in arrays and objects. Then we will look at a few examples and also discuss some quiz.

arrays

var array = [1, 2, 3, 4];
var nestedArray = [1, 2, 3, 4, [7, 8, 9]];

var [a, b, c, d] = array;
console.log(a, b, c, d)