Strangely, the following code gives no error in the lastest Chrome browser:
function func(){
x:1
}
func();
What happened exactly?
(I am not trying to add a property to the function, I know how to do that using func.property
or arguments.callee.property
)
Update: If x:1
is a labeled statement
, then
function func(){
1
}
is considered a valid function. What is 1
here doing? Is it just ignored? Is it a statement, expression or something else?