...

/

Destructuring with the Spread Operator

Destructuring with the Spread Operator

destructuring in Javascript using spread operator, and it's comparison with destructuring using the rest parameter

We'll cover the following...

Let’s create an array that contains the last four characters of another array:

Press + to interact
let notgood = 'not good'.split( '' );
let [ ,,,, ...good ] = notgood;
console.log( good );
// ["g", "o", "o", "d"]

If there are no ...