intersect

This topic describes the syntax and usage of the intersect function in Zoho Creator .

Description

The intersect function returns a list with common elements between two given list values.

Syntax

<list1>.intersect(<list2>)

where, 

<list1> is a variable of type list (mandatory)

<list2 > is a variable of type list (mandatory)

Note: This function is supported only in free-flow scripting mode of Script builder.

Return Value

Returns a list with common elements between two given lists.

Example    

colors = {"red", "blue", "green", "orange"};
fruits = {"apple","orange","banana"};
colors.intersect(fruits);        //returns{"orange"}