Skip to content

Latest commit

 

History

History
42 lines (25 loc) · 599 Bytes

exclusive.md

File metadata and controls

42 lines (25 loc) · 599 Bytes

Exclusive

exclusive

Method returns new array containing non-intersecting items from input arrays.

Note: This method takes at least two arrays.

Usage

const result = ArrayUtils.exclusive(...arrays);

Arguments

  • arrays: ...array - input arrays

Returns

  • array - resulting array

Example

// Get unique elements that are not duplicated between arrays:
const a = [1, 2, 3];
const b = [2, 4, 6];
const c = [3, 5, 7];

const result = ArrayUtils.exclusive(a, b, c);

// "result" is equal to array below:
[1, 4, 6, 5, 7]