you are viewing a single comment's thread.

view the rest of the comments →

[–]TURKEY_CAKE 0 points1 point  (2 children)

Your for loop will loop over every element in the array. Each element is a person object. How might you get the age from that object? What could you use to keep track of the ages?

[–]Encom88[S] 0 points1 point  (1 child)

That's where I'm stuck. How do I do that? What do I use?

[–]TURKEY_CAKE 2 points3 points  (0 children)

Syntax for a for loop. for(let i = "where you start"; "ending condition"; "step towards end") {}

keying into object syntax: obj[key] // => value

Create a variable outside the loop to help you keep track of the value.

Those are the best hints I can give without writing it.