Use the Rest Parameter with Function Parameters

const sum = (…args) => {
let sum=0;
for(let i=0; i<args.length; i++){
return sum;

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more information you give us, the more likely we are to be able to help.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.