function add(...theArgs){ | |
var result = 0; | |
for(let i=0;i<theArgs.length;i++){ | |
result = result + theArgs[i]; | |
} | |
return result; | |
} | |
var r = add(6,9,3,2); | |
console.log(r); | |
var t = add(7,56,9); | |
console.log(t); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment