Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
How to loop through an array after an interval of 5 second for every value in the array?

      const array = [
        "aplus",
        "ant",
        "bean",
        "cookie",
        "corncob",
        "corndog",
        "potato",
        "skunk",
        "rabbit",
        "duck",
        "deer",
        "boar",
        "dragon",
        "seaweed",
        "fish",
        "rarefish",
        "exoticfish",
        "jellyfish",
        "legendaryfish",
        "kraken",
        "junk",
        "garbage",
        "trash",
        "worm",
        "ladybug",
        "stickbuy",
        "spider",
        "banhammer",
        "musicalnote",
        "energydrink",
        "memepills",
        "lawdegree",
        "vaccine",
        "beakerofsusfluid",
        "ectoplasm"
      ];
    setTimeout(function(){
      for (const item of array){
    console.log(item);
}
    }, 5000)

Is there a way to log all the items in the array after an interval of 5 seconds for each item?

When I try to use an setTimeout function it sends the first value after 5 second and after that it sends all the other values at once..

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!