JavaScript ignores spaces, tabs, and newlines that appear between "tokens" in programs, except those that are part of string constants. A "token" is a keyword, variable name, number, function name, or some other place where you would obviously not want to insert a space or a line break. If you place a space or tab or newline within a token, you obviously break it up into two tokens--123 is a single numeric token and 12 3 contains two separate tokens (and constitutes a syntax error, incidentally).
Because you can use spaces, tabs, and newlines freely in your program (except in strings and tokens) you are free to format and indent your programs in a neat and consistent way that makes the code easy to read and understand.
file: /Techref/language/JAVA/script/definitive/ch02_02.htm, 3KB, , updated: 2019/10/14 15:00, local time: 2024/12/4 17:46,
3.147.28.111:LOG IN
|
©2024 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://sxlist.com/Techref/language/JAVA/script/definitive/ch02_02.htm"> [Chapter 2] 2.2 Whitespace and Line Breaks</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232! |
.