Skip to content

Instantly share code, notes, and snippets.

@maximLyakhov
Created January 4, 2022 21:53
Show Gist options
  • Save maximLyakhov/4d0d4aaad4b8e3d2c695abd1fbd60aa9 to your computer and use it in GitHub Desktop.
Save maximLyakhov/4d0d4aaad4b8e3d2c695abd1fbd60aa9 to your computer and use it in GitHub Desktop.
The delay between each request.
const array = ["your", "response", "is", "here"];
const interval = 1000;
array.forEach((el, index) => {
setTimeout(() => {
console.log(`Request ${index + 1}:`, el);
}, index * interval);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment