Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript for...in with Arrays

// define array
const arr = [ 'hello', 1, 'JavaScript' ];

// using for...in loop
for (let x in arr) {
    console.log(arr[x]);
}
 
PREVIOUS NEXT
Tagged: #javascript #Arrays
ADD COMMENT
Topic
Name
3+4 =