3 ms·
Yes, I really enjoy having my variables randomly swap between boolean, integer and float.
by rasz_pl 11y ago
Yes, I really enjoy having my variables randomly swap between boolean, integer and float.
- girvo 11y agoHardly "randomly", although yes it doesn't follow the principle of least surprise.
- rasz_pl 11y agoIts random all right, at least when I parse strings of numbers. Want to compare dates stored as integers? You better parseInt. My small client side js plugin for Wordpress saving date of last visit on every blog page in HTML Storage in order to be able to show you unread comments was randomly bugging out. Not often, just maybe once/twice per day, not enough to make me investigate for a very long time. Turns out Date.parse(list[i].getElementsByTagName("time")[0].childNodes[0].nodeValue.replace(" at ", ' ')) was randomly returning integer results converted to floats ?!?!