WLJS LogoWLJS Notebook

Complement

Complement[eall, e1, e2, ...] gives the elements in eall that are not in any of the ei.

Examples

Find elements not in another list:

Complement[{a, b, c, d, e}, {b, d}]
(* {a, c, e} *)

Multiple lists:

Complement[{1, 2, 3, 4, 5}, {2, 4}, {3}]
(* {1, 5} *)

Please visit the official Wolfram Language Reference for more details.

On this page