Skip to content

Instantly share code, notes, and snippets.

@jjsub
Last active July 6, 2016 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjsub/2ed0966cbd5b6dd62affdbd931fbfc3b to your computer and use it in GitHub Desktop.
Save jjsub/2ed0966cbd5b6dd62affdbd931fbfc3b to your computer and use it in GitHub Desktop.
function reduce(index) {
var arr = [1,2,3,4,5];
return arr.slice(0, index).concat(arr.slice(index + 1));
}
//Passing your own array
function reduce(iarr, index) {
var arr = iarr;
return arr.slice(0, iarr.length - index).concat(arr.slice(index + 1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment