¡GoConqr estrena diseño! Cuéntanos qué te parece.

Módulo 11 de 14 · Multimedia

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

Instrucciones

Para avanzar en el curso, envía un intento de este test. Puedes enviarlo después de la última pregunta.

Ir al módulo elegido

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?