Content deleted Content added
Moved most of the syntax of "JavaScript" into this article |
add "Miscellaneous" section, rename "Exception handling" section |
||
Line 423:
alert ( test.get () )
==Exceptions==
Newer versions of JavaScript (as used in [[Internet Explorer]] 5 and [[Netscape (web browser)|Netscape]] 6) include a <code>try ... catch ... finally</code> [[exception handling]] statement. Purloined from the [[Java programming language]], this is intended to help with run-time errors but does so with mixed results.
Line 462:
}
==
===Case sensitivity===
JavaScript is case sensitive.
===Whitespace===
[[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.
===Comments===
[[Comment]] syntax is the same as in [[C++]].
|