for in
loops over enumerable property names of an object.
for of
(new in ES6) does use an object-specific iterator and loops over the values generated by that.
In your example, the array iterator does yield all the values in the array (ignoring non-index properties).
More Related Contents:
- What is the difference between ( for… in ) and ( for… of ) statements?
- Check if object value exists within a Javascript array of objects and if not add a new object to array
- Pick data from array of objects and return new object
- adding array elements with for loop JavaScript
- How to get all the values associated with an object in array?
- Loop through an array in JavaScript
- How to remove all duplicates from an array of objects?
- Group array of object nesting some of the keys with specific names
- Sum similar keys in an array of objects
- Sort array of objects by single key with date value
- How to add an object to an array
- Add property to an array of objects
- How to update an “array of objects” with Firestore?
- How to map more than one property from an array of objects
- Find and remove objects in an array based on a key value in JavaScript
- Why Array.indexOf doesn’t find identical looking objects
- Javascript: how to dynamically create nested objects using object names given by an array
- JavaScript Loops: for…in vs for
- What is the performance of Objects/Arrays in JavaScript? (specifically for Google V8)
- Using jQuery to compare two arrays of Javascript objects
- Create an empty object in JavaScript with {} or new Object()?
- Javascript group objects by property [closed]
- Getting index of an array’s element based on its properties
- Uncaught TypeError: Object.values is not a function JavaScript
- JavaScript: Remove duplicates of objects sharing same property value
- traversing through JSON string to inner levels using recursive function
- Recursive depth function on an array
- Combining two arrays to form a javascript object
- Sum values from an array of key-value pairs in JavaScript
- Create a dynamic nested object from array of properties