Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. let groceryList = ['orange juice', 'bananas', 'coffee beans', 'brown rice', 'pasta', 'coconut oil', 'plantains'];
  2.  
  3. let friendList = ['beans', 'bananas', 'coconut oil', 'milk', 'soymilk']
  4.  
  5. for ( groceryListIndex = 0; groceryListIndex < groceryList.length; groceryListIndex++ ) {
  6. for ( friendsListIndex = 0; friendsListIndex < friendsList.length; friendsListIndex++) {
  7. if ( groceryList[groceryListIndex] === friendsList[friendsListIndex] ) ; {
  8. console.log(groceryList[groceryListIndex]); } else {
  9. console.log(nothing in common);
  10. }
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement