5
Using the Chrome console I used the following code (valid):
function foo()
{
return {
prop: "some value"
};
}
when the syntax style is changed is no longer valid ({
played to next line):
function foo()
{
return
{
prop: "some value"
};
}
This is a Javascript syntax rule or a bug implementation of browsers? I tested this in Internet Explorer also (same behavior).
Sure there’s nothing else in the code that might be giving you a false positive? Because here, in the most recent Chrome, it worked, quietly, that is, Alert() showed value.
– Bruno Augusto
sure, I’m just testing the basics, your code is the first version I posted, check it out: http://jsfiddle.net/hfHFk/1/
– Leonardo Bosquett