This is probably the simplest one, besides list1.filter(n => list2.includes(n))
var list1 = ['bread', 'ice cream', 'cereals', 'strawberry', 'chocolate']_x000D_
var list2 = ['bread', 'cherry', 'ice cream', 'oats']_x000D_
_x000D_
function check_common(list1, list2){_x000D_
_x000D_
list3 = []_x000D_
for (let i=0; i<list1.length; i++){_x000D_
_x000D_
for (let j=0; j<list2.length; j++){ _x000D_
if (list1[i] === list2[j]){_x000D_
list3.push(list1[i]); _x000D_
} _x000D_
}_x000D_
_x000D_
}_x000D_
return list3_x000D_
_x000D_
}_x000D_
_x000D_
check_common(list1, list2) // ["bread", "ice cream"]
_x000D_