I've got an array of blobs responseArray
. I need to get base64 url value of each blob and push in into array.
let finalScreenshotsArray = []
responseArray.map(blob=> {
var reader = new FileReader();
reader.readAsDataURL(blob);
reader.onloadend = function() {
let base64data = reader.result;
finalScreenshotsArray.push(base64data)
}
})
However, the value of base64data cannnot be accessed outside onloadend
.
EDIT: I have read title of other question, that was linked to it and it's helpful, but doesn't address to my question