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.
Oh and if its more likely that its an unterminating while loop causing the problem then please do bring it up
This comment is hidden because it contains spoiler information about the solution
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.
Id just like to ask what exactly temporary arrays and objects are
Got it thanks!
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.
This comment is hidden because it contains spoiler information about the solution
Hi yes, sorry it seems i seem to have misread it. MY output was 1.69. I jumbled up which is my output and which is the expected outcome. Apologies for the mistake
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.Hi, This might just be me misremembering or being ignorant of mathematical rules, but why is "1.6849117987275881" expected to return "1.69"
I thought round up to two decimals meant u look at the thousandth(3rd) decimal and add 1 to the hundredth(2nd) decimal if its >=5?
! 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.
this is fascinating, can someone explain how it works. Specifically i dont understand !zombies or !range and its use.