Add warning for not Number type (debug mode)
korywka opened this issue ยท 2 comments
korywka commented
Line 154 in 212568d
If x, y, z are string type, getTile returns null. Wasted a lot of time to find it out ๐
Or at least please add it to README.
Thanks.
andrewharvey commented
oh boy, I too spent a lot of time scratching my head wondering why this wasn't working. For the most part JS will naturally convert to a number for most of the code when doing arithmetic, except at
Lines 194 to 196 in aa2522b
It decides to concatenate numbers first, so the results are completely messed up.
I've proposed #128 as a fix, I'd rather getTile just fix up any numbers passed as strings.
korywka commented
๐(personally, I prefer more obviously conversion with Number()
๐)