Grammatical composition:
1. Everything in JavaScript (variables, function names, operators, and so on) are case-sensitive
2. Identifiers in JavaScript (variables, functions, property names, function parameter names), first character must be letter/underscore/dollar sign $, other characters can be letters/numbers/underscores
3. The keyword/reserved word/true/false/null cannot be used as an identifier in JavaScript
Code Comment:
Description: JavaScript uses C-style annotations, including single-line comments (//) and multiline annotations (/**/)
Variable correlation:
1. JavaScript variables are loosely typed (can be used to hold any type of data), defining variables using VAR, followed by variable names (identifier rules)
2. The so-called variable is can be initialized after the amount can be changed, and can be changed to any type of quantity, but there is implicit conversion, performance is not high, need to pay attention to
3. Duplicate var declares the same variable, but is an assignment operation and does not give an error, but there is no need to
4. JavaScript code can be written in one line, a semicolon, separated, when you each statement in a different line, the semicolon can be omitted (JS official recommendation Plus; But as a python developer is not used)
<! doctype html>
This article is from the "ζ Automated operation and maintenance development Road ζ" blog, please be sure to keep this source http://xmdevops.blog.51cto.com/11144840/1846117
Site frontend _javascript.0003.javascript Syntax variables