Arrow Functions, Rest params
Extensions to Functions: Arrow Functions => 123let fn = function(m){return m}; //ordinary functionlet fn = (m) => {return m} //complete writing of arrow functionlet fn
Derek Zhu
Extensions to Functions: Arrow Functions => 123let fn = function(m){return m}; //ordinary functionlet fn = (m) => {return m} //complete writing of arrow functionlet fn
Declares variable a by ‘let’ let is the new way to declare variables in ES6, replacing var. 1234let a;let b, c, d;let e = 100;let f = 521, g = 'iloveyou', h = []; var: allows repeated de
Data in React state cannot be changed directly The code in the example is to directly change (wrong) 1234changeWeather(){ const isHot=this.state.isHotthis.state.Hot=!isHot //Error!console.l
Create class components If the class defines the component, the class must inherit React’s built-in class: React.Component 1class MyComponent extends React. Component{} Among them, the co
Console output class Red represents that the output is an instance object, and blue represents who created the instance object. Person {} If the constructor of the class does not receive parameter