Site frontend _javascript.0003.javascript Syntax variables

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.