function A() {
return {
'name': "a"
};
}
function B() {
return
{
'name': "b"
};
}
console.log(A());
console.log(B());
On my browser this code generates the following error
Uncaught SyntaxError: Unexpected token :
Browser Google Chrome:
Version 74.0.3729.131 (Official Build) (64-bit)
As far as I know JavaScript accepts an end statement after the return statement.
What makes the first return
an end statement but not the second?