Hi again;-), there are different ways to floor a number, this is one way (for example "~~" another). It's not the same as Math.floor, but here it works. It's a "bitwise or" which cuts the part behind the "." and so it gets the integer part of these small and positive numbers here...
Yes... it's not always necessary to use an object/dictionary;-)... Surely normally it's not efficient (indexOf works in O(n)), but short and simple for this really simple kata:-)...
Ah, cheers! I'm not sure it's the most efficient one, but I think it's neat :p
Glad you liked it :)
Hey, thanks :)
I've been using
!!
a lot recently - it's just a nice short alternative to writing out=== true
No problem, so if you have questions (and i'm able to give an answer)... ;-)
Thanks to your tutorial :).
This comment is hidden because it contains spoiler information about the solution
Hi again;-), there are different ways to floor a number, this is one way (for example "~~" another). It's not the same as Math.floor, but here it works. It's a "bitwise or" which cuts the part behind the "." and so it gets the integer part of these small and positive numbers here...
This comment is hidden because it contains spoiler information about the solution
Thanks for your advice. I will use Infinity from now. :)
Yes... it's not always necessary to use an object/dictionary;-)... Surely normally it's not efficient (indexOf works in O(n)), but short and simple for this really simple kata:-)...
Well, I hope at least that is the case with all the people I forced to do this kata :D
Thanks for your feed, cheers!
Glad I taught even a single person something new and good, then :)
@Danoso89
,I'm glad you liked it, thanks for the feedback!