when reading Promise : var promise1 = new Promise(function(resolve, reject) { setTimeout(resolve, 100, foo ); }); if an error is thrown in the executor function, the promise state is rejected. The return value of the executor function is ignored...
a () { return new Promise((res, rej) => { : getData().then(res => { this.data = res.data.reslut console.log(this.data) }) }); } the a method is defined in vue , and the a method is ca...
recently in learning the koa framework to build a node environment, writing a small case requires the following: the node program reads a path, and if it is a folder, put the folder name into the list collection. Promise is used in the program to do asy...
as soon as I came into contact with promise, I wrote a demo by myself. Ask . Why my then only executes once, and how to make it execute multiple times var test = 0; var promise = new Promise(resolve => { $( .btn ).on( click ,()=...
for example Promis.all([p1,p2]).then((p1result,p2result)=>{}); if p1 returns [1mem2p3] p2 returns [4mage5magin6] the final result is a parameter [1mem2magin3], what should I do if I want to use the results of two p objects respectively? ...
this is encapsulated function request(url, params) { let promise = new Promise(function (resolve, reject) { wx.request({ url: url, data: params, header: { X-Token-With : token ...
How does the code return only the result after the last asynchronous operation in the for loop is completed as shown in the figure? Please stop by and give me a hand. ...
problem description installation of webpack and webpack-cli (both-D) in the project is complete, but checking the version number is not found? the environmental background of the problems and what methods you have tried there are hundreds of times...
...
created tcp server, tcpserver: var net = require( net ) var mysql = require( mysql ); var conn = mysql.createConnection({ host: localhost , user: root , password: , database: gprs , port:3306 }); conn.connect(); net.cre...
the conf.d file of the installed nginx is empty. What should I do? the system has installed gcc for nginx, installed by centos7, directly through the yum command ...
import tensorflow as tf import numpy as np x_data=np.float32(np.random.rand(2,100)) y_data=np.dot([0.100,0.200],x_data)+0.300 b = tf.Variable(tf.zeros([1])) W = tf.Variable(tf.random_uniform([1, 2], -1.0, 1.0)) y=tf.matmul(W,x_data)+b loss=tf.reduce_mea...