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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -