And technically that is more accurate because parseInt can cause some issues at very large or very small values.
Actually, it's not an exact duplicate. But the difference is really minor. (Compare these two ugly solutions for this kata and the other kata :)).
didn't check, yeah.
And why is the input string parameter named arr?
Isn't this older than the other one?
This one -> Published Nov 8, 2015
The other one -> Published Aug 13, 2016
exact duplicate of this
There are already two open issues about that, why opening another? Closing.
Too much hints and kata duplicate again
Since the instructions say we do not need to worry about null or undefined values, you can use the unary operator to coerce the number to an int - +number and use a double-bitwise operator to chop any decimal values that may follow - ~~number
Direct link to duplicate (goes to same kata): https://www.codewars.com/kata/5168bb5dfe9a00b126000018
examples from MDN:
parseInt(4.7 * 1e22, 10); // Very large number becomes 4
parseInt(0.00000000000434, 10); // Very small number becomes 4
Don't use parseInt, use Math.trunc
Yes for this Kata I guess the idia is not to use Math object.
But in practice use parseInt Math.trunc!
Don't suggest how to do it.
How many reverse a string kata's are in codewars...?