GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Modul 11 von 14 · Medien

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!).

Anleitung

Um im Kurs weiterzukommen, sende einen Versuch dieses Quiz ab. Du kannst ihn nach der letzten Frage absenden.

Zum gewählten Modul

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck