• ###### Haksellcommented on "Welcome!" javascript solution

This recreates the massive object at every call of the function.
I don't know much about JS, maybe some interpreters are smart and can remember it, but I wouldn't count on that.

• ###### almrdogcommented on "Growth of a Population" javascript solution

While we all want to write more readable code, just remember that 'readability' sometimes depends on our ability to read! More advanced code may seem unreadable for beginners but may actually be very readable and concise the more one learns...

• ###### almrdogcommented on "Growth of a Population" javascript solution

If you want to make it more readable you can always customise the arguments yourself.

• ###### MCLcommented on "Two fighters, one winner." javascript solution

Good point, I didn't think about that in my solution.
However, I argue that it doesn't break if one fighter has damageperAttack = 0.

Divison by zero (while it's not nice) gracefully evaluates to `Infinity` in JavaScript. Furthermore: `Math.ceil(Infinity) === Infinity`. In the end, one of the "factors" is`Infinity`, which will mean that the other factor will always be smaller, provided that only one fighter has zero damage (which was your premise). Ergo: the player with more than 0 damage will always win since he needs less than an infinite number of moves to defeat the opponent. (for any rational number q in JS, we get: `q < Infinity === true`)

However, if both players have 0 damage, the function would declare the first attacker as a winner (since both factors would be `Infinity`, that is they would be equal). Semantically, `undefined` would be a more fitting result as no fighter could ever win or lose. But this (and also stuff like negative damage points) is rather theoretical and not really in the spirit of the exercise.

• ###### abinjawedcommented on "Two fighters, one winner." javascript solution

It means a fighter doesn't take half a turn to attack... he either attacks or doesn't.

Agreed

• ###### vijay4343commented on "Fake Binary" javascript solution

'1234'.split('') = ['1' ,'2' ,'3' ,'4'];

n => n < 5,n is a string and 5 is not,is it possible to compare a string with the number(if not) ,then how the above code worked(without converting n to integer value);

• ###### joebegley15commented on "I love you, a little , a lot, passionately ... not at all" javascript solution

This comment is hidden because it contains spoiler information about the solution

• ###### unosolocommented on "Fake Binary" javascript solution

I like this clever solution the most. However, I don't think it is best practice for producion. You will end up looping the string thrice. I know kata here does not considere the performance for evaluation but, for production, in JavaScript, it is not a good idea. After, seeing this, I will use the reduce method and save a loop. But still, it is not my preferred method when performance matters. But, I need to start thinking more on this kind of solution using map, filter, and reduce methods. It's amazing.

• ###### eternallivingcommented on "Delete occurrences of an element if it occurs more than n times" javascript solution

I got it done, but definitely not the most simplest way. I gotta learn to move away from for loops and learn more maps and filters!! love this simple solution, nice to read too!

• ###### Chrono79commented on "Counting Duplicates" javascript solution

Please use spoiler flag next time.

• ###### bhayashicommented on "Counting Duplicates" javascript solution

This comment is hidden because it contains spoiler information about the solution

noice

• ###### jojooresanyacommented on "Counting Duplicates" javascript solution

wow, this's just absolutely brilliant!

Else.....