look at the following code: function test(){ console.log(this === window); show(); window.show(); function show(){ console.log(this === window, fn ); } } function show(){ console.log(this === window, local ); } tes...
var a = 10; var obj1 = { a: 20, fn: (function() { this.a *= 2; a = 5; var a = 6; return function() { this.a *= a; console.log(a) } })() } var obj2 = { a: 30 } var fn = obj1.f...
< H1 > Code < H1 > undefined (node:5784) UnhandledPromiseRejectionWarning: TypeError: Cannot read property name of undefined at say (D: NodeJS Test test2.js:18:22) ...
in jQuery ajax, why does the this under the data attribute point to my vue instance? As follows: vue data(){ return{ name: test , age:18, } } ajax methods:{ getData(){ $.ajax({ url: test.php , type: post , ...
Why is the value of this tag 1 and this tag 2 different when the second callback is made by the two calls ? function a (val, callback) { callback.call(a,val,callback) } a(1,function b (val ,callback) { console.log(this, 1 ) ...
1, commonfun.js: export default { va:{ 000 : "0", 001 : "1", 002 : "2 }, func:(retcode)=>{ console.log(this); return this.va[retcode]; } } 2, main.js: import vue related dependencies im...
these two are learning the relevant syntax of ES6. When I learned about the this problem of the arrow function, when I compared it with the this in ES5, I found that the following line of code got incredible results: var age = 77; function foo() { ...
when I read the book introduction to ES6, I introduced the arrow function this . The immobilization of this is not because there is a mechanism for binding this inside the arrow function, but because the arrow function does not have its own this, at al...
JavaScript Advanced programming (3rd Edition) P144 the meaning expressed in (2). It s not what I understand. -reference elevation content start- English explanation To create a new instance of Person, use the new operator. Calling a constructor i...
Test and reflection triggered by the "Communication between non-parent and Child components " section of the official website tutorial: is about creating two child components, and the value of component an is passed to component b. <!DOCTYPE html&...
code <script> var num = 100; var obj = { num: 200, inner: { num: 300, print: function () { console.log(this.num); ...
I built a linux virtual machine locally, and then deployed the wordpress project. Why? when I visited the project locally, I prompted that the database link failed, and then I changed the localhost of the DB_HOST configured in the database to the IP of l...
make a list of articles, and then enter the details according to the id of the article. now I have a problem, that is, when my article list jumps to article details according to id, the article details get id and then look up the corresponding columns a...
a = [1, 2, 3] b = [1, 2, 3,] I don t understand. What s the difference between the two arrays? There are a lot of arrays in django that end with a comma. Ask for advice ...
A move (first,modify) method is defined in js, which needs to pass in first,modify. Because I want to reuse the move function, but there are places where you don t need modify, and places where you don t need it, even if you pass a null value, you can...
I used git push to upload the file code: : once I submit it with commit after the client pull comes down, the server overwrites the code modified by the client ...