Read the JavaScript authoritative guide (sixth Edition) Notes (chapter fifth)

Source: Internet
Author: User
Statement

An expression is a phrase in JavaScript, and the statement is a JavaScript whole sentence or command. Use a period to end to separate statements. An expression evaluates a value, but the statement is used to execute to make something happen.

5.2 Compound statements and empty statements

Compound statement: Enclose multiple statements in curly braces to form a conforming statement.

{  x = Math.PI;  CX = Math.Cos (x);     ...................          } First, the end of a statement block does not require a semicolon//second, and the lines in the statement block are indented

Empty statement: A statement that contains 0 statements. An empty statement is a semicolon//; the JavaScript interpreter does not perform any action when it executes an empty statement.

Bugif caused by an empty statement ((a = = 0) | | (b = = 0)); Bad! This line of code didn't do anything ... Loop does not execute o = null; This line of code always executes

  

Read the JavaScript authoritative guide (sixth Edition) Notes (chapter fifth)

Related Article

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.