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

78
Views
Data Structures test

I have a little problem with a test. Can you please help me and tell me what's wrong.

Write a for-in loop to loop through each gamer in the gamerScores object. Inside the loop, use the keys and values from the gamerScores object to log the strings pictured above to the console.

let gamerScores = {
  john: 89,
  paul: 725,
  george: 553,
  robert: 9302,
  steve: 733,
};

for (let i = 0; i < gamerScores.length; i++) {
  console.log(gamerScores[i]);
}

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Here's the MDN documentation on loops and iteration which you might find useful.

let gamerScores = {
  john: 89,
  paul: 725,
  george: 553,
  robert: 9302,
  steve: 733,
};

for (let key in gamerScores) {
  console.log(`${key}: ${gamerScores[key]}`);
}

about 4 years ago · Juan Pablo Isaza Report
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!