Skip to content

Instantly share code, notes, and snippets.

@deathping1994
Created Mar 12, 2016
Embed
What would you like to do?
var add=function()
{
if(arguments.length==0)
{return 0
}
else{
let args=[].slice.call(arguments,0)
args.splice(0,1)
return arguments[0]+add.apply(this,args)//needtoreadaboutapply
}
}
var x=add(3,4,5)
console.log(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment