Simple statements in JavaScript are generally followed by a semicolon character, just as they are in C, C++, and Java. This serves to separate them from the following statement. In JavaScript, however, you are allowed to omit this semicolon if your statements are each placed on a separate line. For example, the following code could be written without semicolons:
a =index.html 3; b = 4;
But when formatted as follows, the semicolons are required:
a =index.html 3; b = 4;
Omitting semicolons is not a good programming practice; you should get in the habit of using them.
file: /Techref/language/java/script/definitive/ch02_03.htm, 3KB, , updated: 2019/10/14 16:00, local time: 2025/4/30 03:36,
18.216.156.171:LOG IN
|
©2025 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://www.piclist.com/techref/language/java/script/definitive/ch02_03.htm"> [Chapter 2] 2.3 Optional Semicolons</A> |
Did you find what you needed? |
![]() o List host: MIT, Site host massmind.org, Top posters @none found - Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
Welcome to www.piclist.com! |
.