For loop with arrays

PHOTO EMBED

Wed Apr 05 2023 22:38:35 GMT+0000 (Coordinated Universal Time)

Saved by @thecowsays #javascript

const cities = ["Washington", "New York", "Boston"];
const arrivalTimes = ["9:14 PM", "12:27 AM", "2:35 AM"];
for (i = 0; i < cities.length;) {
  console.log(cities[i] + ": " + arrivalTimes[i]);
  i++;
}
content_copyCOPY

shows how to create an iterative loop with data from two arrays using the .length property