MCPcopy Index your code
hub / github.com/loiane/javascript-datastructures-algorithms / addAll

Method addAll

src/07-set/set.ts:25–27  ·  view source on GitHub ↗

* Adds multiple values to the set. * @param values - Array of values to add * @complexity Time O(n) | Space O(n)

(values: string[])

Source from the content-addressed store, hash-verified

23 * @complexity Time O(n) | Space O(n)
24 */
25 addAll(values: string[]): void {
26 values.forEach(value => this.add(value));
27 }
28
29 /**
30 * Removes a value from the set.

Callers 2

set.test.tsFile · 0.45

Calls 2

addMethod · 0.95
forEachMethod · 0.45

Tested by

no test coverage detected