Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript loop aray

const myArray = [6, 19, 20];const yourArray = [19, 81, 2];for (let i = 0; i < myArray.length; i++) {  for (let j = 0; j < yourArray.length; j++) {    if (myArray[i] === yourArray[j]) {      console.log('Both loops have the number: ' + yourArray[j])    }  }};
Source by www.codecademy.com #
 
PREVIOUS NEXT
Tagged: #javascript #loop #aray
ADD COMMENT
Topic
Name
3+9 =