This is also my final answer and sorry all for derailing... But it's important to change ideas and get some new perspectives.
It was good article about understanding JS and totally agreed on everything he said (especially "If you don’t understand how statements in JavaScript are terminated, then you just don’t know JavaScript very well").
BUT my point was that semicolons are not obsolete.
And you can't run JS in single line if there are no semicolons to end statement - Not even JS leaders can do this (or any referenced institute/organization/individual)...
I have been programmed with different languages all my life (now about 30 years and JS about 12 years) and I've seen these pit falls many times during this time... Just trying to help others here.
It was good article about understanding JS and totally agreed on everything he said (especially "If you don’t understand how statements in JavaScript are terminated, then you just don’t know JavaScript very well").
BUT my point was that semicolons are not obsolete.
And you can't run JS in single line if there are no semicolons to end statement - Not even JS leaders can do this (or any referenced institute/organization/individual)...
Code:
let i = 0 let j = 1 ... // Errors
let i = 0; let j = 1; ... // No errors
let obj = function {} obj.prototype.x = function () {} let y = 1 function b() {} let a = '' // Several errors
let obj = function () {}; obj.prototype.x = function () {}; let y = 1; function b() {} let a = ''; // No errors...
// Notice that for example function b() {} doesn't need semicolons even in single line modeI have been programmed with different languages all my life (now about 30 years and JS about 12 years) and I've seen these pit falls many times during this time... Just trying to help others here.
Yeah I understand, just wanna share my point is if dev write a good and clean code enough and understand those edge cases, semicolons is not necessary :kaojoy: Otherwise, semicolon or not is most likely about the taste and project conventions.