+ 2

Two arrays

There are two arrays, with some objects, with the same keys. How possible to find equal objects in arrays?

20th Nov 2018, 11:08 AM
Grigoriy
Grigoriy - avatar
2 ответов
+ 1
Loop through arrays and compare every value.
20th Nov 2018, 11:26 AM
Микола Федосєєв
Микола Федосєєв - avatar
+ 1
var arr1=[1,2,3,4,5] var arr2=[3,4,2,6,9] var equals=arr2.filter(e=>arr1.includes(e)) use the filter method
20th Nov 2018, 11:28 AM
᠌᠌Code X
᠌᠌Code X - avatar