⇧
vadnica-logo
My Services About the Project Telegram O meni O meni

JavaScript for...in Loop

The for...in loop is primarily intended for iterating over the keys of objects. When used on an object, it returns the property names (e.g., "name", "age"), not the values.

Although it can also be used on arrays (where it returns indexes), using for...of or the classic for loop is recommended for arrays, as for...in may return inherited properties and is not guaranteed to iterate in order.

EXAMPLE
RESULT