Answers for "for loop and array in javascript"

1

loop an array in javascript

let array = ["loop", "this", "array"]; // input array variable
for (let i = 0; i < array.length; i++) { // iteration over input
	console.log(array[i]); // logs the elements from the current input
}
Posted by: Guest on May-18-2020
-2

loop array in javascript

var colors = ["red", "green", "blue"];
for(var i = 0; i < colors.length; i++){
	console.log(colors[i]);
}
Posted by: Guest on October-01-2020
0

javascript loop and array

var array = ["hello","world"];
array.forEach(item=>{
	console.log(item);
});
Posted by: Guest on June-27-2020
0

javascript loop array Example

let answer1 = "It's alright";
let answer2 = "He is called 'Johnny'";
let answer3 = 'He is called "Johnny"';
Posted by: Guest on October-31-2021

Code answers related to "for loop and array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language