Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let groceryList = ['orange juice', 'bananas', 'coffee beans', 'brown rice', 'pasta', 'coconut oil', 'plantains'];
- let friendList = ['beans', 'bananas', 'coconut oil', 'milk', 'soymilk']
- for ( groceryListIndex = 0; groceryListIndex < groceryList.length; groceryListIndex++ ) {
- for ( friendsListIndex = 0; friendsListIndex < friendsList.length; friendsListIndex++) {
- if ( groceryList[groceryListIndex] === friendsList[friendsListIndex] ) ; {
- console.log(groceryList[groceryListIndex]); } else {
- console.log(nothing in common);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement