Should you use semicolons in JavaScript?
nicozerpa.com
nicozerpa.com
More like someone didn’t read on how ASI works and has wrong expectations.
There are two ways of learning, each with its own benefits. One is to read carefully and note the common pitfalls to not step into these. Another is to skim through, get the intuition and address pitfalls later. What we see here is just that “address later” part. Which is not an issue on itself, cause that’s the way you chose to learn.
Since ASI is a part of the language everyone has to learn it, because now if you put a semicolon like this:
return
{
…
};
It still doesn’t do what an unaware person would expect.