ECMA is the abbreviation for European Computer Manufacturers Association, the European Association of Computer manufacturers. The European Association of Computer manufacturers is an international standard organization for the development of information transmission and communication.
ECMAScript is a standardized scripting language developed by ECMA.
The ECMAScript version currently used by JavaScript is ECMAScript-262.
First, use JavaScript
In the HTML or XML header
<script type= "Text/javascript" src= "Demo1.js" ></script>
Second, the grammar
1, case-sensitive: including variables, function names and operators.
2, identifier: refers to the variable, function, the name of the property, or the parameters of the function.
Note: The first character must be a letter, cannot use keywords, reserved words. such as: mybook11
3. Comments:
ECMAScript uses C-style annotations, including single-line comments and block-level annotations.
Single-line Comment
/*
* This is a multi-line
* Notes
*/
4, the amount of literal or face:
All direct quantities (literals) are the data values that are displayed directly in the program.
100//Digital literal
' Li Shiming '//string literal
False//Boolean literal
/js/gi//Regular expression literals
Null//Object literal
In ECMAScript version 3rd, expressions like array literals and object literals are also supported, as follows:
{x:1, Y:2}//object literal expression
[1,2,3,4,5]//array literal expression
Iii. keywords and reserved words
JS-specific keywords, typically used to control the start or end of a statement, or to perform a specific operation. Keyword is also language reserved and cannot be used as an identifier
ECMAScript All Keywords
Break Else new Var
Case finally return void
Catch for switch while
Continue function this with
Default if throw delete
In Try do instanceof
typeof
Iv. variables
The ECMAScript variable is loosely typed, and the so-called loose type is used to hold any type of data. Use the var operator when defining variables (Var is the key), followed by a variable name (the variable name is an identifier).
var box;
alert (box);
The variable is not assigned a value, and the system gives it a special value-undefined (undefined)
This article is from the "Linux Warden" blog, so be sure to keep this source http://sswqzx.blog.51cto.com/2494644/1966003
JavaScript series (i) syntax, key reserved words, variables