logo
logo

Remove First Two

Easy

Remove First Two

Easy
Create a function
removeFirstTwo
that takes in an array and uses array destructuring with the rest operator to return a new array with all elements except for the first two. If the array has less than two elements, return an empty array. For example,
removeFirstTwo([1, 2, 3, 4, 5])
would return
[3, 4, 5]
.
Console
Submit
Solution
00:00