![]() |
VOOZH | about |
Lodash _.intersection() method is used to take the intersection of one or more arrays. It is the same as the intersection in set theory.
_.intersection([arrays]);Example 1: In this example, we are finding the intersection of two arrays.
Output:
👁 ImageExample 2: In this example, we are finding the intersection of more than two arrays.
Output:
👁 ImageExample 3:In this example, we are finding the intersection of two arrays in which one is empty that is why we did not get any new intersected array as they do not have common elements.