JavaScript syntax: Difference between revisions

Content deleted Content added
typo
Quamaretto (talk | contribs)
I left a summary and the quote in the article body. The rest seem to be original research. Thanks for providing a source.
Line 1:
The '''syntax of JavaScript''' is a set of rules that defines how a [[JavaScript]] program will be written and [[Interpreter (computing)|interpreted]]. The JavaScript syntax deriveswas largelyinfluenced fromby the [[Cseveral programming language]]languages, withincluding influence[[Java from(Programming [[Self_programming_languagelanguage)|SelfJava]] 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:
{{"|JavaScript borrows most of its syntax from [[Java_programming_language|Java]], but also inherits from [[Awk]] and [[Perl]], with some indirect influence from [[Self_programming_language|Self]] in its object prototype system.}}
 
===Origin of Syntax===
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:
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:
#[[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++.
{{"|JavaScript borrows most of its syntax from [[Java_programming_languageJava_(Programming_language)|Java]], but also inherits from [[Awk]] and [[Perl]], with some indirect influence from [[Self_programming_language|Self]] in its object prototype system.}}
#[[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.
##Exact syntax of function declaration, including the formal parameter list.
##The functions ''match'', ''length'', ''split'', and ''substring'' with almost identical syntax and semantics.
#[[Perl_programming_language|Perl]] contributed details of regular expression handling.
#[[Self_programming_language|Self]] contributed the object prototype system.
 
===Variables===