While working on a javascript issue for our project, we notice the strange behavior of integers and strings.We were about to validate numbers that starts with 000123852 as our application stores the product id like this.while validation for the overall length of 9, the value suddenly changes to a random number 342391.

Later we identified alert(000123456); in the javascript console, we will find a random number 42798 .Finally we passes the numbers as strings.