Skip to content

Instantly share code, notes, and snippets.

@ceaksan
Last active September 18, 2015 14:09
Show Gist options
  • Save ceaksan/84216a9d4234dbe52ecb to your computer and use it in GitHub Desktop.
Save ceaksan/84216a9d4234dbe52ecb to your computer and use it in GitHub Desktop.
function slasher(arr, howMany) {
if (howMany < 1) return arr;
else return arr.splice(howMany, arr.length);
}
slasher([1, 2, 3], 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment