Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
^^
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
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
1.if( n > 3){
return result;
}
or
2. for (let i = 2; i <= n; i += 1)
Oh, yeap, ty for feedback. It was need for me, i tested what function return.
You need to
return
the value notreturn 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.I used spread with "use strict"
This comment is hidden because it contains spoiler information about the solution