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
H A R S H H A A -
Joan Peramás Ceras -
Hamza Khan -
Michael Ukachi -
Top comments (2)
Short and sweet, I like it.
I like it. This is exactly what I was looking for.