Answers for "array traversal in javascript"

0

traverse an array in javascript

//Method 1 using for loop

let array = [ 1, 2, 3, 4, 5, 6 ]; 
for (let index = 0; index < array.length; index++) { 
    console.log(array[index]); 
}

//Method 2 using for Of loop

for (let traverse of array ){
  console.log(traverse)
}
Posted by: Guest on February-20-2021
1

javascript traverse

Javascript traverse refers to moving through the DOM for finding an 
specific element in a webpage. 

You usually traverse when you select an element by its relation with other
elements

You can find more about it here: https://zellwk.com/blog/dom-traversals/
Posted by: Guest on August-30-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language