I'm facing strange convertion in JavaScript:
function getFromDatabase(){
//the result may be gotten from database or some complex methods and CANT be changed!
return 000000;
}
var param = getFromDatabase();
alert(param);// -> 0
alert(param.toString());// -> 0
alert("" +param + "");// -> 0
How can I get 000000 or "000000" ?
000000in numerics is just0for the interpreter, which theparamholds 0. Use string quotes around it to "bypass" it