Last active
July 6, 2016 16:20
-
-
Save jjsub/2ed0966cbd5b6dd62affdbd931fbfc3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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