O'Reilly logo
  • Ahmed Elgendy thinks this is interesting:

The while loop is most often used when you don’t know how many times you need to loop, and you’re looping until a condition is met. The for loop is most often used when you know the number of times the loop needs to execute.

From

Cover of Head First JavaScript Programming

Note

Again the major difference between For and While loop?