Re:Be careful with JS numbers
by Joeri on Sunday January 13, 2013 @04:52PM
(#5052018)
Been burned by this myself, because while the person that created the ID knew it was a string, the person using it down the line thought it looked like a number and treated it like one.
My advice is to store those ID's with a leading "$" character or something similar. Removes the temptation to treat them like numbers.
My advice is to store those ID's with a leading "$" character or something similar. Removes the temptation to treat them like numbers.