I just stated learning JS and I was trying a very simple code when I got a strange result which I cannot explain why it happened. I tried to define a very simple array like below:
var a=['hello',0,"2313dog!"," ",45.78,-021,-657]
But once it’s executed in Chrome console the element -021 was changed to -17 , like:
["hello", 0, "2313dog!", " ", 45.78, -17, -657]
I know -021 is not a number, and I can add it as a tring, but I don't now why and how it changed to -17. Can someone please explain what happened and if there is a name for this. Thanks!