Question 14/22
intermediate
Select one answer

What is the difference between for-in and for-of?

for-in iterates over values, for-of iterates over keys
for-in iterates over object keys, for-of iterates over iterable values
They are exactly the same
for-of works on objects, for-in works on arrays

Premium Question

Upgrade to unlock this question and 300+ more interview prep MCQs.