TZinovieva

Common Elements

Jan 25th, 2023
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function commonElements(arr1, arr2) {
  2.  
  3.     for (let i = 0; i < arr1.length; i++) {
  4.             if (arr2.includes(arr1[i])) {
  5.                 console.log(arr1[i]);
  6.             }
  7.     }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment