Created
August 27, 2020 10:22
-
-
Save ogwurujohnson/46e824545b77950c99ae37596db43412 to your computer and use it in GitHub Desktop.
Loop and append to Another array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getAddress = async (addresses) => { | |
const existingAddresses = []; | |
const res = addresses.map(async (item) => { | |
const address = await getAddressInfo({ nrg_address: item }); | |
// console.log(address); | |
if (address) { | |
console.log("here"); | |
return existingAddresses.push(address); | |
} | |
}); | |
return Promise.all(res).then(() => existingAddresses); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment