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

122
Views
What is the "for loop" equivalent for this "for-of loop"?

I know how to iterate over an object by destructing it in the 'for-of loop' which I consider an easy method:

let cafeHours = {
    thurs: {
      open: '11:00 am',
      close: '11:00 pm',
    },
    fri: {
      open: '10:00 am',
      close: '11:00 am',
    },
    satur: {
      open: '8:00 am',
      close: '11:00 pm',
    }, 
};

let hours = Object.entries(cafeHours);

for (let [day, {open, close}] of hours) {
  console.log(`On ${day}day we open at ${open} and close at ${close}`);
};


I was wondering whether I can iterate over this object and it's objects using a Normal for loop which contains 3 statements which is like this? (and get the above result)

for (let i = 0; i<hours.length; i++){
    
};

Please tell me if I'm complicating stuff but I get really curious sometimes

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!