JavaScript basic syntax

Source: Internet
Author: User

First, the basic syntax of JavaScript is defined in a pseudo-language called ECMAScript, and understanding ECMAScript's details is the key to understanding its implementation in the browser, most browsers now follow ECMAScript 3rd edition, But many have also begun to implement the 5th edition, the following total reading today:

Five of the 1.EcmaScript variables are of this type: boolean,number,object,null,undefined

2.EcmaScript does not add different data types for integers and floating-point numbers, but it automatically converts meaningless floats to integers in the background (1.0=1)

3.Object is the underlying type for all objects

4. Strict mode provides restrictions on where the language is prone to error

5.EcmaScript provides many of the same basic classes as the C language, including arithmetic (+-*/%) operators, Relationships (><=!) operator, bit operation (&^/~|>><<), etc.

6. Stream control statements, such as if, for and switch, are borrowed from other languages, but there are many different places, such as switch, which can be compared with arbitrary expressions, even variables

7. No need to specify function return value, can return any value anywhere, no return value will be undefined

There is no concept of signature in 8.EcmaScript, because a function is passed as an array of 0 or more values, so it is possible to pass parameters with arguments to access the parameters, so it cannot be overloaded.

9. Because ECMAScript uses the IEEE754 format, so there will be a lot of accuracy problems, such as: 0.1+0.2!=0.3 (do not believe you try it), it is recommended to use floating point number when not used = =, try to use >= or <=

This article is all personal reading after the summary, reproduced please declare the source

JavaScript basic syntax

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.