JSPM

  • Created
  • Published
  • Downloads 232
  • Score
    100M100P100Q82737F
  • License MIT

A set is a collection of unique values.

Package Exports

  • extra-set

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (extra-set) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

A set is a collection of unique values.

const set = require('extra-set');

var s = new Set([1, 2, 3, 4]);
set.difference(s, [1, 3]);
// Set(2) { 2, 4 }

var t = new Set([2, 3]);
set.isDisjoint(t, [4, 5]);
// true

set.symmetricDifference([1, 2, 3], [2, 3, 4]);
// Set(2) { 1, 4 }

reference

Method Action
is Checks if value is a set.
isEqual Checks if two sets have the same values.
isSubset Checks if set is part of all collections.
isSuperset Checks if all collections are part of set.
isDisjoint Checks if collections have no value in common.
union Gives a set with values from all collections.
union$ Gives a set with values from all collections.
intersection Gives a set with values in all collections.
intersection$ Gives a set with values in all collections.
difference Gives a set excluding values in collections.
difference$ Gives a set excluding values in collections.
symmetricDifference Gives a set with values in odd number of collections.

nodef

Browserified, minified version of this package is extra-set.min.