Hey guys im stumped i have this piece of code. Which get some data from google sheets and puts it into an array. To be more specific it getting an address and amount. Its than makes an array of little arrays inside the array. Then im getting the array and looping through it i but i want it to pause for 10 seconds before the next array. This is what i have:
const randomArray = [];
for (var i = 0; i < rows.length; ++i) {
let row = rows[i];
randomArray.push(row);
}
for (const data of randomArray) {
setTimeout(() => {
const AddressID = data[0];
const Amount = parseFloat(data[1]);
console.log(AddressID, Amount);
}, 5 * 1000);
}
}
There is a total of 4 address and 4 amounts. I need it to do (address, amount) stop 10 seconds and do it again till it gets to the last one. What I have done waits 5 seconds and then just spits out all 4 address's and amounts all in one go.