Ad
  • Custom User Avatar

    What's wrong with mutating the argument??

    I agree with the first bit ;)

  • Custom User Avatar

    That sorted it!

    I've never had to use that argument before. Worthy is further investigation!

    Thanks.

  • Custom User Avatar

    I am able to pass all except one test.

    I receive the following error message:

             TypeError: Reduce of empty array with no initial value
             at Array.reduce
              at solution
              at test
                  at /runner/frameworks/javascript/cw-2.js:159:11
              at Promise._execute
              at Promise._resolveFromExecutor
              at new Promise
              at Object.describe
                      at Object.handleError
                  at ContextifyScript.Script.runInThisContext
              at Object.exports.runInThisContext
              at Object.
    

    I have tried an if statement to return 0 in the event on an empty array before reducing but still get the same...

    Any help appreciated.

  • Custom User Avatar

    Process was terminated. It took longer than 12000ms to complete