Created
March 12, 2016 05:52
-
-
Save deathping1994/97cc4e26bf4b28455c8d 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
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