What types of collections can the for...of loop iterate over in JavaScript?
- Arrays
- Objects
- Strings
- All of the above
The for...of loop can iterate over iterable objects like arrays, strings, maps, sets, etc. However, it does not work with non-iterable objects like plain objects (use for...in for objects).
Loading...
Related Quiz
- When a function execution completes, it is removed from the __________.
- What happens when you try to create a new Symbol using the new keyword?
- Can Promises help in avoiding callback hell in asynchronous JavaScript code?
- In an application dealing with an array of user objects, which higher-order function would be best for filtering users based on specific criteria?
- What potential issues might arise from using mixins in ES6, and how can they be mitigated?