freeCodeCamp: ES6: Use the Rest Operator with Function Parameters - spread operator test fails

Challenge Name

https://beta.freecodecamp.org/en/challenges/es6/use-the-rest-operator-with-function-parameters

Issue Description

The challenge fails on the last test "The sum function uses the … spread operator on the args parameter. I have tripled checked my code, reset it and refreshed but it doesn’t seem to recognize the spread operator is being used.

I found this but not sure if related: Reference: https://github.com/freeCodeCamp/freeCodeCamp/issues/12698

Browser Information

Browser Name, Version: Operating System: FireFox 57.0 (64-bit) and Chrome Version 63.0.3239.84 (Official Build) (64-bit) Mobile, Desktop, or Tablet: Laptop Windows 10 Professional 64-bit

Your Code


`"use strict()";
function sum(...array) {
    return array.reduce((a, b) => a + b, 0);
}
console.log(sum(1, 2, 3)); // 6`

Screenshot

image

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (17 by maintainers)

Commits related to this issue

Most upvoted comments

On it. Thanks @systimotic