So I am passing a string into a javascript function. for example:
function dothis(x,y,z){
something
}
dothis(year,month,contract); // contract = "A10-009_xyz"
I know this has something to do with the way javascript deals with 08 and 09, but I am unsure of the best way to deal with it in my case.
the error I'm getting is
09 is not a legal ECMA-262 octal constant
dothis(2012, 01, A10-009_xyz);
I saw some people suggesting using number(string)
or parceInt("09","10")
but I'm unsure of how to impliment with this as the string will be changing a lot. Am I supposed to check the string before placing into the function and look for 08,09 and replace with the parceInt()
?
Thanks for any help, suggestions etc appriciated.