2.5.22 • Published 3 years ago

@extra-iterable/symmetric-difference v2.5.22

Weekly downloads
26
License
MIT
Repository
github
Last release
3 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

3 years ago

2.5.21

3 years ago

2.5.20

3 years ago

2.5.18

3 years ago

2.5.17

3 years ago

2.5.14

3 years ago

2.5.13

4 years ago

2.5.9

4 years ago

2.5.10

4 years ago

2.5.11

4 years ago

2.5.12

4 years ago

2.5.8

4 years ago

2.5.7

4 years ago

2.5.6

4 years ago

2.5.5

4 years ago

2.5.4

4 years ago

2.5.0

4 years ago

2.5.2

4 years ago

2.5.1

4 years ago

2.5.3

4 years ago

2.4.50

4 years ago

2.4.51

4 years ago

2.4.47

4 years ago

2.4.49

4 years ago

2.4.48

4 years ago

2.4.45

4 years ago

2.4.46

4 years ago

2.4.44

4 years ago

2.4.43

4 years ago

2.4.42

4 years ago

2.4.39

4 years ago

2.4.41

4 years ago

2.4.40

4 years ago

2.4.38

4 years ago

2.4.37

4 years ago

2.4.29

4 years ago

2.4.28

4 years ago

2.4.27

4 years ago

2.4.25

4 years ago

2.4.24

4 years ago

2.4.26

4 years ago

2.4.21

4 years ago

2.4.23

4 years ago

2.4.22

4 years ago

2.4.20

4 years ago