Feb 5 - Daily Challenge

I tried to complete the Daily Challenge where you are required to output the sum of an array as change in cash (“$D.CC“). My code however seems to not be working when I submit my answer.

I have tested the output in my IDE but the console in FreeCodeCamp throws a reference error when I try to console log the function. I believe my solution is adequate but can’t seem to understand why it does not pass the test.

Any thoughts?

I have attached a screenshot of the challenge below.

The FCC editor runs in “strict mode” so you need to use let and const even though you don’t need to use those in your editor.

https://www.freecodecamp.org/news/how-to-use-strict-mode-in-javascript/

1 Like