Answers for "how to loop through an array and find a value"

1

create a loop that runs through each item in an array

Create a loop that runs through each item in the "fruits" array.

var fruits = ['Apple', 'Banana', 'Orange']

for(x of fruits){
	console.log(x);
}
Posted by: Guest on June-10-2021
1

Iterate Through an Array with a For Loop

var arr = [10, 9, 8, 7, 6];
for (var i = 0; i < arr.length; i++) {
   console.log(arr[i]);
}
Posted by: Guest on December-22-2020

Code answers related to "how to loop through an array and find a value"

Code answers related to "Javascript"

Browse Popular Code Answers by Language