I don't think semicolons help your example.
return
{
foo: 7
};
still returns undefined. return
{
foo: 7
};
still returns undefined.I was really explaining why rookies will make mistakes with js. The simplest way to prevent those types of errors is to always use ; and to use { on the same line style.