code.ashish.me

Atom feed

Recently added: 128 Longest Consecutive Sequence, 347 Top K Frequent Elements, 045 Jump Game 2, 228 Summary Ranges, 219 Contains Duplicate 2

09 Slasher Flick

/**
 * Created by Ashish Patel
 * Copyright © 2017 ashish.me
 * ashishsushilpatel@gmail.com 
 */

/**
 * 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.
 */

function slasher(arr, howMany) {
    return arr.slice(howMany,arr.length);
}
  
console.log(slasher([1, 2, 3], 2));

Created 2019-11-24T04:53:20+05:30 · Edit