code.ashish.me

Atom feed

Recently added: 02 Count Of Subset Sum, 416 Partition Equal Subset Sum, 01 Subset Sum, 518 Coin Change 2, 983 Minimum Cost For Tickets

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:41:20+05:18 · Edit