You are here: Start » Filter Reference » Array Set Operators » ArrayIntersection

Returns an array of elements contained in all of the input arrays (without duplicates).

Name | Type | Description | |
---|---|---|---|

inArray1 | <T>Array | First input array | |

inArray2 | <T>Array | Second input array | |

inArray3 | <T>Array* | Third input array (optional) | |

inArray4 | <T>Array* | Fourth input array (optional) | |

outArray | <T>Array | Intersection of the input arrays |

The type of this filter is defined using the type variable **T** which represents any valid type. Read more.

### Description

The operation computes an array of elements contained in all of the input arrays. The operation treats arrays as if those were sets, i.e., disregards the repeated elements in the input arrays and computes the result without repeating elements.

### Examples

inArray1 = {1,1,1,2,2,3} inArray2 = {1,1,4} |
outArray = {1} |

### Remarks

Please note, that this filter can be concretized only with basic data types and structures of such types. Concretizing the filter with a non-comparable complex data type, such as Image or Region, will raise a Domain Error.

Using this filter to compare data of type Real (or structures with this type) may be tricky. It is caused by the fact that very small (unnoticeable) differences in values of such types may lead to unpredictable negative results in comparison of these values.

### Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

Non-comparable complex data type "*TypeName*" used in ArrayIntersection.

### Complexity Level

This filter is available on **Expert** Complexity Level.

### See Also

- ArrayUnion – Returns an array of elements contained in at least one of the input arrays (without duplicates).