Open swati-jagtap opened 3 years ago
function sum() { var s=0; for(let i=0;i<arguments.length;i++) { s+=arguments[i]; } return `sum of ${arguments.length} arguments is ${s}` ; } console.log(sum(1,2,3,4,5)); console.log(sum(12,20,3));`
7.3.11--Call your function sum, it takes any number of arguments and it returns the sum.
output