intersect
Table of Contents
Overview
The intersect function returns the common elements present in two given collections.
Return Type
- DECIMAL
Syntax
<variable> = <collectionVariable1>.intersect(<collectionVariable2>);
where,
Parameter | Data type | Description |
<variable> | LIST | Variable which will hold the returned list. |
<collectionVariable1> <collectionVariable2> | COLLECTION | Variables from which the common elements will be returned. |
Examples
products1 = collection("Creator", "CRM", "Books"); products2 = collection("Creator", "CRM", "Mail"); info products1.intersect( products2 ); // returns "Creator", "CRM"