Pages

Wednesday, March 2, 2016

SLASHER FLICK

In this challenge I have to return the remaining elements of an array after chopping off n elements from the head.

The head means the beginning of the array, or the zeroth index.

1 comment:

  1. it may also like this
    function slasher(arr, howMany) {
    // it doesn't always pay to be first

    var x=arr.splice(howMany);
    return x;
    }

    slasher([1, 2, 3], 2);


    ReplyDelete