To iterate over the keys in an object, you can use the for...______ loop.
- For...Of
- For...In
- For...Each
- For...While
To iterate over the keys in an object, you can use the for...In loop. This loop is specifically designed for iterating over object properties, allowing you to access each key. The for...Of loop, on the other hand, is used for iterating over the values of iterable objects like arrays.
Loading...
Related Quiz
- Which keyword is used to check a condition in JavaScript?
- The _______ pattern is used to create an instance of an object with some default values.
- A(n) _______ function returns a promise.
- Which method would you use to add a new property to an object after it has been created?
- How does the for...of loop handle objects by default?