Why do JavaScript statements have to end with a semicolon ";"? -
while writing js code front-end business project, wondered why have end js statements semicolon ?
so main use of semicolon in javascript ?
thanks answers.
';' mean end of code line , ';' can write js code in 1 line @ following example
alert("a")alert("b"); //this return error uncaught syntaxerror
but
alert("a");alert("b");//this work fine
Comments
Post a Comment