store 的值是未定义的。colud 告诉我我做错了什么。我应该使用 Async 和 wait 还是 Promise ?
var store = db.read(collectionName, (status, data) => {
//database read function
if (status) {
names.listOfData = data;
var send = names;
console.log("send---->", send); // send value here is what I need to return.
return send; // Getting required data for send. Problem here is returning it and storing it in store.
} else {
return null;
}
});
console.log("商店-->", 商店);
这里 store 的值是未定义的。没有适当的回报
倚天杖
相关分类