[Go to site: main page, start]

0% found this document useful (0 votes)
3 views1 page

JavaScript For Loop Questions

The document contains a list of 20 JavaScript 'for' loop coding questions. Each question requires the implementation of a 'for' loop to perform various tasks such as printing numbers, calculating sums, and manipulating arrays. The tasks range from basic operations like printing numbers to more complex operations like finding prime numbers and reversing arrays.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

JavaScript For Loop Questions

The document contains a list of 20 JavaScript 'for' loop coding questions. Each question requires the implementation of a 'for' loop to perform various tasks such as printing numbers, calculating sums, and manipulating arrays. The tasks range from basic operations like printing numbers to more complex operations like finding prime numbers and reversing arrays.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JavaScript 'for' Loop Coding Questions

1. Write a for loop that prints numbers from 1 to 10.

2. Write a for loop that prints even numbers from 2 to 20.

3. Write a for loop that prints the multiplication table of 5.

4. Write a for loop that prints numbers from 10 down to 1.

5. Write a for loop that prints all elements in an array.

6. Write a for loop that sums numbers from 1 to 100.

7. Write a for loop that prints only odd numbers from 1 to 20.

8. Write a for loop that prints characters of a string.

9. Write a for loop that calculates the factorial of a number.

10. Write a for loop that prints the square of numbers from 1 to 10.

11. Write a for loop that counts how many times a specific character appears in a string.

12. Write a for loop that finds the largest number in an array.

13. Write a for loop that prints all prime numbers between 1 and 50.

14. Write a for loop that reverses an array.

15. Write a for loop that prints the Fibonacci sequence up to 10 terms.

16. Write a for loop that removes all vowels from a string.

17. Write a for loop that copies all even numbers from one array to another.

18. Write a for loop that prints the index and value of each array element.

19. Write a for loop that creates a new array with each value squared from the original array.

20. Write a for loop that checks whether an array contains a specific value.

You might also like