Content deleted Content added
Rescuing 6 sources and tagging 0 as dead.) #IABot (v2.0 |
m →Variables: Wikified the first instance of ES6 |
||
Line 85:
==Variables==
[[Variable (programming)|Variable]]s in standard JavaScript have no [[Type system|type]] attached, and any value can be stored in any variable. Starting with [[ECMAScript#6th_Edition_-_ECMAScript_2015|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.
|