+ 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 Answers
+ 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