I want to execute a loop with promises, but I want to execute a method only after the loop completes.
This is a similar example of that I want to do
const array = ['a', 'b', 'c'];
console.log('start');
array.forEach((i) => {
setTimeout(()=> console.log(i), 3000);
});
console.log('end');
this the result i got.
start
end
a
b
c