Ad
  • Custom User Avatar
  • Custom User Avatar

    1.) You have declared sum and string_Sum as global variables, as you have declared them outside of the function. This means everytime the function is called, it will keep adding to this global variable - you can see this by each test adding on the previous test. To fix this declare them as local variables by putting them within the function.

    2.) You don't have to manually call the function like you have in your last statement - the testcases automatically call it for you.

    3.) Remove the spaces from the count variable size check. It wants it without spaces (for some reason).

    4.) Use markdown with three backticks to format code - see here https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code-and-syntax-highlighting

  • Custom User Avatar

    You need to return the value not return and print the value. Returning the value allows recall of the value which can be checked for equality, console.log() just outputs the value to the console. Just remove the console.log() from your return value.