MCPcopy Index your code
hub / github.com/immutable-js/immutable-js / subtract

Method subtract

src/Set.js:134–150  ·  view source on GitHub ↗
(...iters)

Source from the content-addressed store, hash-verified

132 }
133
134 subtract(...iters) {
135 if (iters.length === 0) {
136 return this;
137 }
138 iters = iters.map((iter) => SetCollection(iter));
139 const toRemove = [];
140 this.forEach((value) => {
141 if (iters.some((iter) => iter.includes(value))) {
142 toRemove.push(value);
143 }
144 });
145 return this.withMutations((set) => {
146 toRemove.forEach((value) => {
147 set.remove(value);
148 });
149 });
150 }
151
152 sort(comparator) {
153 // Late binding

Callers

nothing calls this directly

Calls 8

withMutationsMethod · 0.95
SetCollectionClass · 0.90
forEachMethod · 0.80
someMethod · 0.80
mapMethod · 0.65
includesMethod · 0.65
pushMethod · 0.65
removeMethod · 0.65

Tested by

no test coverage detected