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.
jsfiddle only calls your function once. CW calls your function multiple times. That's the difference.
Think about what happens when your function is called the second time ;-)
Edit: Even better, don't just put 1 function call on your jsfiddle. Put multiple of them, in the exact way the tests in CW are done ;-)
Better than me explaining it, why don't you try calling your function several times and checking the result?
Already told you before, the global var (count) keeps its value between tests, giving you wrong values after the first call.
Variable "b" inside "reducer" function must be integer, so you can use a * parseInt(b),
you can delete for loop, keep if-else statement.
Also "reduce" need initial value (1 in your case).
Hint: you should use "return" on two places (becouse of recursion).
Don't use global vars, they keep their values between tests.
Your function doesn't return.
No problem. Now after you've done it your way, I suggest you see how other people solved it and learn different ways of doing it.
Debug your code for that case then. If you still have the same problem, you're not using reduce the right way.
This comment is hidden because it contains spoiler information about the solution
Remove the if and read this
Simplify your code, why are you trying to use a promise here? You're trying to use some complex things without needing them. You have like 6 loops there and this kata can be solved with only one.
Return 0 if no multiple of 3 or 5 is found.
My guess is you're counting the number passed in too when it says:
There is only one sample test after all.
Hi, you probably encountered certain edge case. You can paste your solution here (with spoiler) and someone who finished this kata earlier can see your solution and try to help.