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

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -