JavaScript

Explain the spread operator

Easy
6
Added
Allows iterables to be expanded in places where arguments/elements are expected.

Solution Code

JavaScript
const arr = [1, ...[2,3], 4]; // [1,2,3,4]
Explanation
Can be used for array/object copying, merging, and function arguments.

Guided Hints

Shallow vs deep copy
Rest parameters