container intersect(container1, container2)
Returns a copy of container1 containing only the elements/keys also present in container2.
- container1 — first container, either array or dictionary.
- container2 — second container of the same type as the first.
- a copy of container1 with the elements/keys both containers have in common.