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); ...
use iframe to load a page of another domain in a html page. There is an install button on the page. Click to install the application, and find that this pop-up window cannot pop up in the ios system. The picture in the following figure is installed...
console.log (this.$router.path) can t get, undefined ...
as mentioned above, when mysql is installed in linux environment, there is a problem when wget downloads the mysql package. The decompression error is as follows: it is said on the Internet that the downloaded package is damaged. But I used md5sum t...
problem description the environmental background of the problems and what methods you have tried related codes Please paste the code text below (do not replace the code with pictures) < H1 > place an order < H1 > def post_order_place (requ...
A Java project, after being packed into a jar package through maven, is run on a Linux server. What are all the Chinese garbled codes in the log? But there is no problem with the same jar package running on macos The same code, compiled on Windows and ru...