The new features of ECMAScript 6 (ES6) can be divided into new syntax (e.g. Class), enhanced JavaScript functionality (such as import), and improved JS "bugs" (for example, let keyword). Most blogs will be the three types of new features mixed
1:4 kinds of binding rules
Precedence from highest to lowest order1:new binding
var o = {
m:function () {return this
;
}
}
var obj = new o.m ();//obj for the newly generated object
console.log (obj,obj = = O);//{} false
Console.log (
1. Introduce yourself
2. Project Introduction
3. CSS
1) Introduce CSS box model
The box model basically becomes the question which the interview must ask, has the box model of the common-system and the box model under IE browser, the box model
ECMAScript 6(ES6)The development or the popularity of the rapid can be said to be unimaginable, for many people ECMAScript 5(ES5) are still popular. Modern browsers have ES6 more or less support for new and newer, but the support is not high, so you
Using the timer in JS (setinterval,settimeout), it is easy to encounter this point of the problem.Directly on the example:1 varname = ' My name is window ';2 varobj = {3Name: ' My name is obj ',4Fn:function () {5 varTimer =NULL;6
Master "this" in JS (2)
In the previous article, master the"this(1) We learned how to correctly usethisKeyword and its basic principle. We also know the decisionthisThe key factor pointing to an object is to find the current execution context ).
You can use this to point to the newly created object when you create the constructor yourself in JavaScript. This prevents the this in the function from pointing to the global, as follows var x = 2; function Test () { this. x = 1; }
Common functionsHere's the normal function.function add(x, y) { return x + y;}Each normal function is called when it is equivalent to having a this parameter passed in.The intrinsic function This is not an external function that is passed in this,
about JS In this point of understanding! What is this?Definition: This is the object to which the function that contains it belongs when the method is invoked.The first thing to say is thatthe point of this is not deterministic at the time of the
Rule 1: Use new after this to point to the object created by newfunction __new () { this" test " console.log (this )}varnew __new ()This is the object created by the new construct, which points to itRule 2: Use call or apply this to point to
1. The mystery of this
Most of the time this keyword is filled with mysterious colors for me and many JavaScript developers. This is a powerful feature, but it requires effort to be understood.
From Java, PHP, and other standard language
One, arrow functionGeneral function 1var function (A, b) { return a + b;}General function 2function Add (A, b) { return a + b; }Arrow functionsvar add = (A, b) = + A + b;If there is only one return value inside the function, you do
Es6 notes 4 ^_^ function, es6 notes 4 functionI. Default function parameters
Now you can specify the default value of a parameter when defining a function, instead of using logic or operators as before.Es5
Function sayHello (name) {// The
Objective
This article is mainly for ES6 to do a brief introduction, perhaps you do not know what ES6 is, in fact, it is a new JavaScript specification. In a time when everyone is busy, if you want to have a quick understanding of ES6, read on to
React native is the direct use of ES6 to write code, many new syntax can improve our productivity
Deconstruction Assignment
var {
Stylesheet,text,view
} = react;
This code is the new deconstruction (destructuring) assignment statement
Visual Studio Code is a great editor that starts very quickly and can be used instead of other text file editing tools. can also be used to do development, support a variety of languages, compared to other Ides, lightweight fully configurable and
I. About BABEL
babelis the es6+ syntax compiler, official website: Www.babeljs.io, used to convert the old version of the browser unrecognized syntax and features into ES5 syntax, so that the code can apply more environment.
The initial babel use is
Let's start with a few terms:
official
my story.
corresponding Code
React element
React elements
let element=A爆了
Component
Component
class App extends React.Component {}
Objective
Recently has been playing angularjs, have to say, compared to knockout,angularjs this MVVM framework is more powerful, and more complex, various tutorials online everywhere, but the real use of the project will encounter a variety of pits.
The scope and context (contexts) in JavaScript are unique to the language, thanks in part to the flexibility they bring. Each function has a different context and scope of variables. These concepts are backed by some powerful design patterns in
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.