03/06/2026
20 JAVASCRIPT QUESTIONS
Covering for, for...in, for...of (Basic to Advance)
⭐ ADVANCED
14. What is the difference between for...in and for...of?
15. Use for...in to iterate over an array and explain the output.
16. Use for...of to iterate over a string and print each character.
17. Write a program to find the maximum number in an array using for...of.
18. Can we use for...of with objects? Why or why not?
19. Write a nested for loop to print the following pattern:
* * *
* *
*
20. What is the difference between iterating with index (for) vs for...of in performance?