Sunday, May 6, 2018

for loop - JavaScript - myArray.length

var myArray = ["Doug", "Laura", "Vera", "Gabriela"];

for (var i =0; i < myArray.length; i++)

{
     console.log("Hello, " + myArray[i]);

//looping through an array with a for each loop
not so common and it doesn't provide a lot of granularity during the construction

for (var element of myArray)

     console.log("Good bye, " + element);
}
  

No comments:

Post a Comment

Spatial Epidemiology of Agrochemical Exposures and Chronic Pathologies: A Multidimensional Analysis of Pesticide Use, Oncological Trends, and Parkinsonian Clusters in the United States

The relationship between the large-scale application of synthetic chemicals and the incidence of chronic, life-altering diseases represents ...