I have a function that shows me all from object.
queries = {
"info": {
"query": "SELECT ...",
"id": "10"
},
"info2": {
"query": "INSERT ...",
"id": "12"
},
"infoN": {
"query": "DELETE ...",
"id": "123"
}
}
for (var [key, value] of Object.entries(queries)) {
let name = key;
let query = value.query;
let id = value.id;
console.log(name);
console.log(query);
console.log(id);
//setTimeout(function() { }, 3000);
}
But I need to to show first object and after 3 sec another and so on. How can I loop them with setTimeout? Or something similar?