javascript| Function | problem
This question may be overlooked, and I have encountered it in the project. Write a reminder to everyone!!!
When using JavaScript's parseint function, parseint ("08") or parseint ("09") returns incredibly 0, while parseint ("a") ... parseint ("07") are all right, it's hard to understand at first, The reason for this problem is that when there is a "0" in front of it, JavaScript's debugger think it is a octal number, and "08" and "09" are not a legitimate octal number, which leads to that problem, but parsefloat does not.
In fact, the parseint method has an optional parameter to represent the number, so this should not be a bug, but we don't usually notice the details. The solution is simply to use parseint ("08", 10) or parseint ("09", 10) to notify the JavaScript interpreter to use decimal to parse it.