Content deleted Content added
Most syntax elements were taken over from C, inserted examples providing evidence |
Wikified citation. Inserted reference to C++ comments. |
||
Line 1:
The '''syntax of JavaScript''' is a set of rules that defines how a [[JavaScript]] program will be written and [[Interpreter (computing)|interpreted]]. JavaScript syntax derives largely from the [[C programming language]], with influence from [[Self_programming_language|Self]] in its prototype system. Brendan Eich summarized the ancestry of the syntax in the first paragraph of the [http://hepunx.rl.ac.uk/~adye/jsspec11/intro.htm#1006028 JavaScript 1.1] specification as follows:
A popular fallacy grants Java the most influence on the syntax of JavaScript. Direct [http://www.lurklurk.org/rosetta.html comparison] between JavaScript and the langauges mentioned above reveals in a different view:
#[[C programming language|C]] contributed control flow syntax with keywords like ''if'', ''else'', ''while'', ''continue'', ''switch'', ''case'', and ''default''. The semantics of these control flow elements is identical. C also contributed arithmetic and logic operators like ''&&'', ''||'', and ''!''. JavaScript inherits the syntax of comments from C++.
#[[AWK_programming_language|AWK]] contributed
##Exact syntax of access to associative arrays, including the loop over hashes (associatve arrays) with the ''for (key in object)'' iteration.
|