MA
Size: a a a
MA
AK
AK
MA
MA
MA
AK
MA
AK
AK
const array = [];
function pushElem(i) {
return new Promise(function (resolve, reject) {
input.read(i, (file) => {
array.push(file);
resolve();
});
});
}
let promise = new Promise(function (resolve, reject) {
input.size(async (size) => {
for (let i = 0; i < size; i++) {
await pushElem(i);
}
resolve();
});
});
promise.then((array) => {
console.log(array);
});
MA
AK
MA
AK
MA
AK
AK
KH
TS