const a = [1, 2, 3];
const [b] = a;
b
// 1
[] is the decomposing operator.
Also:
const [c, ...rest] = a;
c
// 1
rest
// [2, 3]
... is the rest operator.
const a = [1, 2, 3];
const [b] = a;
b
// 1
[] is the decomposing operator.
Also:
const [c, ...rest] = a;
c
// 1
rest
// [2, 3]
... is the rest operator.
For further actions, you may consider blocking this person and/or reporting abuse
Ashley D -
Santhiya G -
Dhanush -
Aleksey Nagovitsyn -
Top comments (2)
Short and sweet, I like it.
I like it. This is exactly what I was looking for.