While looking at a question related to porting a PHP function to JavaScript. I saw what I assumed was incorrect JavaScript:
function my_isnum(str, negative=false, decimal=false)
Then I tried this in JSFiddle:
function my_isnum(str, negative=false, decimal=-2)
{
console.log(arguments);
console.log(str);
console.log(negative);
console.log(decimal);
}
my_isnum("5", "Hi");
And to my utter amazement this is what I see in the Firebug console:
["5", "Hi"]
5
Hi
-2
Now in Chrome this is what I see:
Uncaught SyntaxError: Unexpected token =
What I don't understand is this an example of some early standard being supported by Firefox (the MDN on function
doesn't seem to mention this)?