+ 1

Why the program does not shows error if i did not use semicolon after a statement?

I had written the following program: <html> <head> <title></title> </head> <body> <script type="text/javascript"> var num=100 document.write(num) </script> </body> </html> In this program, I had not used semicolon to separate the statements but the program does not shows any kind of error. Why? I Kindly request you to answer my question and clear my doubt. THANK YOU

12th Apr 2020, 9:41 AM
Sameer Ahamed
Sameer Ahamed - avatar
2 Respostas
+ 1
In HTML you don't use a semicolon after a statement.unlike in CSS and JavaScript
12th Apr 2020, 10:16 AM
Adrian
Adrian - avatar
0
Spike Sameer now, you don't need to use semicolon in js or javascript. But it is recommended to use semicolon. Language like java the still will show you errors if you miss semicolon
12th Apr 2020, 4:11 PM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar