Array.shift

Easy
11
68.6% Acceptance

In this coding challenge, you will be implementing a function called removeFromBeginning(array) that takes one argument: an array. The function should remove one element from the beginning of the array.

Example test cases

removeFromBeginning([1, 2, 3]); // Output: [2, 3] removeFromBeginning(['foo', 'bar', 'baz']); // Output: ['bar', 'baz']

Hints

  • You can use the built-in method .shift() directly on the input array.