Consider these two functions.
function func1() {
return
{
foo: 'bar'
}
}
function func2() {
return {
foo: 'bar'
}
}
alert(typeof func2()) //return object
alert(typeof func1()) //return undefined
Why does the position of the braces matter when in many other languages it does not? Is it a language feature or a bug?