JS Basic knowledge

Source: Internet
Author: User

。 I. Understanding the browsers used in the development of the previous section

1. Google Chrome: WebKit kernel (V8 engine)

The WebKit core also includes the iphone's own safari, most domestic browsers (360. Sogou, QQ, Cheetah), Android and most iOS mobile browsers.

2. Mozilla Firefox: Gecko kernel

3. Open Gate Browser: Presto kernel

4.IE Browser: Trident kernel

2. Each browser in order to show their own different, not in accordance with the standards, but the standard of the effect in another way to achieve. For example, if you want to get the style of all the elements in JS

window.getComputedStyle

Currentstyle (IE)

Three. JS Basics Note the place

JS in the import code block 3 kinds

--

--Also in CSS, there are four ways to import

Similarly, the format is converted to characters.

ES6 and ES5 differences

1. When defining variables, the ES5 application of VAR,ES6 is to use let in let,es6 to form a block-level scope that resolves the scope and nesting problems in ES5, and then optimizes both performance and code.

The added function in 2.ES6 can change the this point in the project ....

Variables and constants

Cont ES6 NEW

Specification for JS naming rules

The fourth type is most commonly used later.

Because the first time typeof, no matter what the side of the checkout is, it's a string, so the second third time is a string. The same alert will also pop up the string.

Number (NULL)->0

Number (undefined)->nan

Although number ("12px")-nan is not wrong, in some cases it is necessary to introduce a new approach if only to obtain valid numbers:

JS Basic knowledge

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.