Skip to content

Instantly share code, notes, and snippets.

@shahab570
Created January 1, 2021 15:49
Show Gist options
  • Save shahab570/161a372d8fdd9aa103085286fa717e03 to your computer and use it in GitHub Desktop.
Save shahab570/161a372d8fdd9aa103085286fa717e03 to your computer and use it in GitHub Desktop.
function sum(...args) {
let sum =0 ;
for (let arg of args) {
sum += arg;
}
console.log(sum);
}
sum(1,2,3,4); // 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment