1let array1 = ['element1', 'element2', 'element3', 'element4'];
2let array2 = ['array2element', 'element2', 'element4'];
3let mutualArrayElements = [];
4
5for (let i = 0; i < array1.length; i++) {
6 for (let j = 0; j < array2.length; j++) {
7 if (array1[i] === array2[j]) {
8 mutualArrayElements.push(array1[i]);
9 }
10 }
11};
12// for nested loops