javascript - JS semicolon removes 'Uncaught SyntaxError: Unexpected identifier' error why? -
my code this:
message.labels.foreach(/…/) container.data.push(message);
it throws uncaught syntaxerror: unexpected identifier
when add semicolon after foreach
function doesn't throw anymore. change semicolon there, checked git.
why it? feels i'm missing js fundamentals here.
the semi-colon ends statement.
if leave out, 2 statements treated single one, doesn't make sense , compiler throw error.
Comments
Post a Comment