JavaScript syntax: Difference between revisions

Content deleted Content added
BobEret (talk | contribs)
eval (expression): Added information about the security risk represented by eval
Rescuing 6 sources and tagging 0 as dead.) #IABot (v2.0
Line 87:
[[Variable (programming)|Variable]]s in standard JavaScript have no [[Type system|type]] attached, and any value can be stored in any variable. Starting with ES6, the version of the language finalised in 2015, variables can be declared with <code>let</code> (for a [[block scope|block level]] variable), <code>var</code> (for a [[function scope|function level]] variable) or <code>const</code> (for an immutable one). However, while the object assigned to a <code>const</code> cannot be changed, its properties can. Before ES6, variables were declared only with a <code>var</code> statement. An identifier must start with a letter, underscore (<tt>_</tt>), or dollar sign (<tt>$</tt>); subsequent characters can also be digits (<tt>0-9</tt>). Because JavaScript is case sensitive, letters include the characters "A" through "Z" (uppercase) and the characters "a" through "z" (lowercase).
 
Starting with JavaScript 1.5, [[ISO 8859-1]] or [[Unicode]] letters (or <tt>\uXXXX</tt> Unicode escape sequences) can be used in identifiers.<ref>{{cite web | url=https://developer.mozilla.org/en/JavaScript/Guide/Values,_Variables,_and_Literals&revision=22#Variables | title=Values, Variables, and Literals - MDC | date=16 September 2010 | publisher=Mozilla Developer Network | access-date=1 February 2020 | archive-url=https://web.archive.org/web/20110629131728/https://developer.mozilla.org/en/JavaScript/Guide/Values%2C_Variables%2C_and_Literals%26revision%3D22#Variables | archive-date=29 June 2011 | url-status=dead }}</ref> In certain JavaScript implementations, the at sign (@) can be used in an identifier, but this is contrary to the specifications and not supported in newer implementations.
 
===Scoping and hoisting===
Line 1,684:
* [http://www.how-to-code.com/javascript/comparison-operators-in-javascript.html Comparison Operators in JavaScript]
* ECMAScript standard references: [http://www.ecma-international.org/publications/standards/Ecma-262.htm ECMA-262]
* [https://web.archive.org/web/20120527095306/http://javalessons.com/cgi-bin/fun/java-tutorials-main.cgi?sub=javascript&code=script Interactive JavaScript Lessons - example-based]
* [http://javascript.about.com/ JavaScript on About.com: lessons and explanation]
* [https://web.archive.org/web/20150110202627/http://wisentechnologies.com/it-courses/JavaScript-Training-in-Chennai.aspx JavaScript Training]
* Mozilla Developer Center Core References for JavaScript versions [https://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference 1.5], [https://web.archive.org/web/20070210000908/http://research.nihonsoft.org:80/javascript/CoreReferenceJS14/index.html 1.4], [https://web.archive.org/web/20070210000504/http://research.nihonsoft.org:80/javascript/ClientReferenceJS13/index.html 1.3] and [https://web.archive.org/web/20070210000545/http://research.nihonsoft.org:80/javascript/jsref/index.htm 1.2]
* [https://developer.mozilla.org/en/docs/JavaScript Mozilla JavaScript Language Documentation]