|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
703 bytes
|
| Rev | Line | |
|---|
| [a762898] | 1 | /**
|
|---|
| 2 | * Computes the symmetric difference of the provided arrays, returning an array of elements
|
|---|
| 3 | * that exist in only one of the arrays.
|
|---|
| 4 | *
|
|---|
| 5 | * @template T - The type of elements in the arrays.
|
|---|
| 6 | * @param {...(ArrayLike<T> | null | undefined)} arrays - The arrays to compare.
|
|---|
| 7 | * @returns {T[]} An array containing the elements that are present in only one of the provided `arrays`.
|
|---|
| 8 | *
|
|---|
| 9 | * @example
|
|---|
| 10 | * // Returns [1, 2, 5, 6]
|
|---|
| 11 | * xor([1, 2, 3, 4], [3, 4, 5, 6]);
|
|---|
| 12 | *
|
|---|
| 13 | * @example
|
|---|
| 14 | * // Returns ['a', 'c']
|
|---|
| 15 | * xor(['a', 'b'], ['b', 'c']);
|
|---|
| 16 | *
|
|---|
| 17 | * @example
|
|---|
| 18 | * // Returns [1, 3, 5]
|
|---|
| 19 | * xor([1, 2], [2, 3], [4, 5]);
|
|---|
| 20 | */
|
|---|
| 21 | declare function xor<T>(...arrays: Array<ArrayLike<T> | null | undefined>): T[];
|
|---|
| 22 |
|
|---|
| 23 | export { xor };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.