That is a sensible way to think about it, and it would be great if the language worked that way, but unfortunately it does not. Statements in JavaScript are not separated by line breaks.
Here is an example to illustrate:
console.log('a')
(1 < 2) ? console.log('b') : console.log('c')
You might expect this to output 'a', then 'b'. However, it instead outputs 'a' and then throws an error like this:
Uncaught TypeError: console.log(...) is not a function
...because a semicolon was
not inserted at the end of the first line.