they auto inject the semicolon.
try this ;)
function x() {
return
12;
}
function y() {
return (
12
);
}
console.log(x());
console.log(y());
and actually it gives the expected result since newline and no opened scope so it injects ;
JS is bad language design that's nothing new.
destroyallsoftware.com/talks/wat
it has different advantages.