2.5.22 • Published 4 years ago

@extra-iterable/symmetric-difference v2.5.22

Weekly downloads
26
License
MIT
Repository
github
Last release
4 years ago

Gives values not present in both iterables. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Similar: union, intersection, difference, symmetricDifference.

This is part of package extra-iterable.

iterable.symmetricDifference(x, y, [fc], [fm]);
// x:  an iterable
// y:  another iterable
// fc: compare function (a, b)
// fm: map function (v, i, x)

:stopwatch: Compare function => O(n²).

const iterable = require("extra-iterable");

var x = [1, 2, 3, 4];
var y = [3, 4, 5];
[...iterable.symmetricDifference(x, y)];
// [ 1, 2, 5 ]

var y = [-3, -4, -5];
[...iterable.symmetricDifference(x, y)];
// [
//    1,  2,  3, 4,
//   -3, -4, -5
// ]

[...iterable.symmetricDifference(x, y, (a, b) => Math.abs(a) - Math.abs(b))];
// [ 1, 2, -5 ]

[...iterable.symmetricDifference(x, y, null, v => Math.abs(v))];
// [ 1, 2, -5 ]

References

2.5.22

4 years ago

2.5.21

4 years ago

2.5.20

4 years ago

2.5.18

4 years ago

2.5.17

4 years ago

2.5.14

5 years ago

2.5.13

5 years ago

2.5.9

5 years ago

2.5.10

5 years ago

2.5.11

5 years ago

2.5.12

5 years ago

2.5.8

5 years ago

2.5.7

5 years ago

2.5.6

5 years ago

2.5.5

5 years ago

2.5.4

5 years ago

2.5.0

5 years ago

2.5.2

5 years ago

2.5.1

5 years ago

2.5.3

5 years ago

2.4.50

5 years ago

2.4.51

5 years ago

2.4.47

5 years ago

2.4.49

5 years ago

2.4.48

5 years ago

2.4.45

5 years ago

2.4.46

5 years ago

2.4.44

5 years ago

2.4.43

5 years ago

2.4.42

5 years ago

2.4.39

5 years ago

2.4.41

5 years ago

2.4.40

5 years ago

2.4.38

5 years ago

2.4.37

5 years ago

2.4.29

5 years ago

2.4.28

5 years ago

2.4.27

5 years ago

2.4.25

5 years ago

2.4.24

5 years ago

2.4.26

5 years ago

2.4.21

5 years ago

2.4.23

5 years ago

2.4.22

5 years ago

2.4.20

5 years ago