Answers for "i want to loop through a string that is inside of any array"

12

javascript loop through array

var myStringArray = ["hey","World"];
var arrayLength = myStringArray.length;
for (var i = 0; i < arrayLength; i++) {
    console.log(myStringArray[i]);
    //Do something
}
Posted by: Guest on September-05-2019
6

loop through array javascript

/* ES6 */
const cities = ["Chicago", "New York", "Los Angeles"];
cities.map(city => {
	console.log(city)
})
Posted by: Guest on January-04-2020

Code answers related to "i want to loop through a string that is inside of any array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language