Rest parameter exercise

Tell us what’s happening:
Hello Everyone
I think this exercise should be successful logically , but it keeps giving me an error message that reads
, sum should be an arrow function which uses the rest parameter syntax (...) on the args parameter.
any small hint will be greatly appreciated

  **Your code so far**
const sum = (...n) => {
const args = [...n];
return args.reduce((a, b) => a + b, 0);
}
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36

Challenge: Use the Rest Parameter with Function Parameters

Link to the challenge:

You need to have the rest parameter in the arguments and use it. This line is not needed. The tests are expecting you to replace the use of this internal temporary variable args.

1 Like