So, if I have something like the following:
let searchObj = {};
for (var i = 0; i < list.length; i++){
var info = client.runFunction(variable, 0, -1, async function(err, result){
var amount = parseInt(result[0]);
searchObj[result1[i]] = amount;
});
}
How can I access searchObj from outside of the callback? If I debug and print from within the callback, it works, otherwise it doesn't.
-
1Does this answer your question? how to get all keys and values in redis in javascript?Leibale Eidelman– Leibale Eidelman2021年03月18日 15:57:07 +00:00Commented Mar 18, 2021 at 15:57
-
That's super helpful, thank you. Will check it out.ricksanchezmortysmith– ricksanchezmortysmith2021年03月18日 16:09:51 +00:00Commented Mar 18, 2021 at 16:09
lang-js