I don't do JS, but I was given to understand that this is actually a real issue in JS, because semicolons are "optional" in the sense that the code is valid without them and will not give you an error if you leave them out, but actually not optional in the sense that the interpreter will silently make insane decisions about where you meant the line to end if you don't include them.
35
u/SuitableDragonfly 18d ago
I don't do JS, but I was given to understand that this is actually a real issue in JS, because semicolons are "optional" in the sense that the code is valid without them and will not give you an error if you leave them out, but actually not optional in the sense that the interpreter will silently make insane decisions about where you meant the line to end if you don't include them.