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:
- Check if object value exists within a Javascript array of objects and if not add a new object to array
- Difference between ( for… in ) and ( for… of ) statements?
- Checking if a key exists in a JavaScript object?
- Most efficient method to groupby on an array of objects
- Convert Array to Object
- How to get the difference between two arrays of objects in JavaScript
- Why can I add named properties to an array as if it were an object?
- Firestore Update single item in an array field
- Why does typeof array with objects return “object” and not “array”? [duplicate]
- How can I access and process nested objects, arrays or JSON?
- Sum JavaScript object propertyA values with the same object propertyB in an array of objects
- Filter array of objects with another array of objects
- How to get objects value if its name contains dots?
- Convert JavaScript array of 2 element arrays into object key value pairs
- Perform .join on value in array of objects
- Create a reset of javascript Array prototype when Array.prototype has been modified?
- What’s the difference between “{}” and “[]” while declaring a JavaScript array?
- Deep comparison of objects/arrays [duplicate]
- Count duplicates within an Array of Objects
- How do I group items in an array by date?
- Two arrays, where items in array x can be in array y but not vice versa, test all permutations
- Array.includes() to find object in array
- push() a two-dimensional array
- Find all values by specific key in a deep nested object
- Javascript oddness with array of objects and indexOf
- Filter nested array in object array by array of values
- Lodash create collection from duplicate object keys
- Best way to flatten JS object (keys and values) to a single depth array
- Javascript: hiding prototype methods in for loop?
- How to merge duplicates in an array of objects and sum a specific property? [duplicate]