WLJS LogoWLJS Notebook

ContainsExactly

ContainsExactly[list1, list2] yields True if list1 contains exactly the same elements as list2.

ContainsExactly[list2] is an operator form that yields True when the object to which it is applied contains exactly the same elements as list2.

Examples

Same elements in different order:

ContainsExactly[{3, 1, 2}, {1, 2, 3}]
(* True *)

Different elements:

ContainsExactly[{1, 2, 3}, {1, 2, 4}]
(* False *)

Duplicates are ignored:

ContainsExactly[{1, 1, 2}, {1, 2, 2}]
(* True *)

Please visit the official Wolfram Language Reference for more details.

On this page