GoConqr has a new look! Let us know what you think.

Module 11 of 14 · Media

Object Iteration

Kostas Diakogiannis

Object Iteration

Object Iteration

Objects are iterable data types. That means we can loop through each of an object's property and check it's value and many more. 

This is done by using the for in loop. As shown above this strange for loop is comprised of 2 parts. In this case the 'prop' represents each of object's  keys and the 'jake' the object we iterate on.  We can choose then to print either the keys or the object. Prop is no specific keyword and it can be named as you like, it acts like a placeholder for every key.

 

Object iterations are very useful when used in combined with the hasOwnProperty native method to check for existing properties to nested objects. (Yep is possible!).

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?