I have an array,That contain some records with image.I'm trying to do is,convert image url in to base64 and assign new records into new Array.but i'm getting empty array.
var newArray = [];
devices.map(async (data) => {
const imgData = await axios.get(data.image[0], { responseType: 'arraybuffer' })
let returnedB64 = Buffer.from(imgData.data).toString('base64')
newArray.push([data.identifier, data.model, data.imei,
data.locationText, returnedB64])
})
console.log("Final array --->", newArray) //i'm getting empty