• undefined
-
To determine whether a value is empty, use congruence, because null and undefined are the same for two equals signs
-
‘A’ in window means whether a is declared globally
-
Void – Evaluates the given expression and returns undefined equivalent to the keyword void (0) evaluating 0
-
Undefined is both a primitive data type and a primitive value data, which is an attribute of the global object window.undefined
-
Cannot write cannot configure cannot enumerate cannot redefine
This point,
-
An attribute of the current environment executor context object. This behaves differently in different contexts.
-
Js gets the global object -window, self, frames, this. The generic way to get global: globalThis
-
The calSS class is essentially a function, a container/scope/module/shell. Methods added directly to this from constructor are non-static methods of the class-methods/attributes added to this during the new procedure. Class static methods are defined with the class’s prototype{… } properties inside.. By default, an object must have a “proto” that points to the constructor or class’s prototype property. }. “proto” is the join point of the prototype chain.. If the Test method is not found on the object, it follows the prototype chain
4. Call /bind/apply
Constructor () {// no this binding this. Age = 44; } swim () { console.log('GO SWIMMING') } } class Son extends Father { constructor () { // Super goes to the top (you can't access this until super() is called) // What super() does: // this -> new father () -> super(); // this -> new father () -> {} super(); Constructor = "fishing" console.log(this.age) // 44} study () {constructor = "fishing" console.log(this.age) // 44} study () { Console.log (this) // There is no swim method in this._proto_. Swim this.swim(); }} Const son = new son ();}} Const son = new son (); son.study(); Var obj = {a: 1} var obj2 = {a: 1} var obj2 = {a: 1} 100 } var a = 2 function test(b, c) { console.log(this.a, b, c) } test() // 2,undefined,undefined test.call(obj) // 1 undefined undefined test.apply(obj) // 1 undefined undefined // Test. Call (obj, 3, 4) // 1 3 4 test. Apply (obj, [3, 4]) // 1 3 4 const t1 = test.bind(obj, 3, 4) 4).bind(obj2, 3, 4) // 1 const t2 = test.bind(obj2, 3, 4).bind(obj, 3, 4) // 100 ```Copy the code
5. Arrow function
The arrow function ignores any form of this pointing to change, static this pointing to, and the arrow function is not a constructor (can’t new).
This in the arrow function is not bound to whom; this in the arrow function points to the outer scope of the non-arrow function.
The constructor returns this implicitly by default, or manually. If a new object is returned manually, the object to which this points is ignored.
The this inside the event handler refers to the bound DOM element
Promise is the asynchronous problem synchronization solution
Map cannot be traversed with for in
For in should not be used to iterate over an array that focuses on index order
A getter intercepts a variable when it accesses it
var _default = 0; Object.defineProperty(window, 'a', { get () { return ++_default } }) if (a === 1 && a === 2 && a === 3) { console.log('win') //win } var len1 = ({} + {}).length; Var len1 = ([] + []).length; var len1 = ([] + []).length; Var len3 = (function(){}).length; // The parameter number is 0Copy the code