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.
A temporary array/object is a place for you to store values and then stitch them together again.
I assume the kata wants you to implement a sorting algorithm... unless it thinks comparisons should also count as a temporary object, in which case, I am at a loss.
For objects, see there: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object
With temporary arrays, I assume the description means you not create any other and should use only the input array.
You shouldn't use for...in with arrays https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in#array_iteration_and_for...in
Not a kata issue.
In javascript, the test with
7
as input value expects"1.68"
, not"1.69"
.Yes, that is correct,
and where's the issue here?- I looked at the string you're returning again and there might be a problem indeed. Please, tell which input your solution is failing on, maybe even post the solution itself (with a spoiler tag) just in case. Note that the description clearly states how the result should be calculated, so if your code isn't following the formula, any incorrect results you're getting are your own mistake.! is the NOT operator, so !zombies, read it like "no zombies". It is the same condition as zombies == 0.
if (!zombies): if zombies == 0 then zombies evaluates to false and then !false = true
if zombies != 0 then zombies evaluates to true and then !true = false
I hope it helped you.