Content deleted Content added
Line 562:
[[Space (punctuation)|Space]]s, [[tab]]s and [[newline]]s used outside of string constants are called [[whitespace]]. Unlike C, whitespace in JavaScript source can directly impact semantics. Because of a technique called "semicolon insertion", any statement that is well formed when a newline is parsed will be considered complete (as if a semicolon were inserted just prior to the newline). Programmers are advised to supply statement terminating semicolons explicitly to enhance readability and lessen unintended effects of the automatic semicolon insertion.
''Unnecessary whitespace'', whitespace characters that are not needed for correct syntax, can increase the amount of wasted space, and therefore the file size of .js files. Where file compression techniques that remove unnecessary whitespace are used, performance can be improved if the programmers have included these so-called 'optional' semicolons.
The easiest way to address the problem of file size is to set the server to use zip compression. This compression will work far better than any whitespace parser. This method will work with or without semi-colons, but they should be used anyway for readability.
===Comments===
|