loop

  • Javascript for of vs for in vs for each Dec 22 2017
    If you are new to Javascript (or even a seasoned js developer), you will probably get confused when trying to understand the different types of for loops. So let’s go through the javascript for of vs for in vs for each loop. Standard for loop Suppose we have an array called myArray. Here’s how you would iterate through it using the standard for loop: var myArray = ['Cat','Dog','Horse']; for(let i =0; i< myArray.