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

Method push

src/Stack.js:49–69  ·  view source on GitHub ↗
(/*...values*/)

Source from the content-addressed store, hash-verified

47 // @pragma Modification
48
49 push(/*...values*/) {
50 if (arguments.length === 0) {
51 return this;
52 }
53 const newSize = this.size + arguments.length;
54 let head = this._head;
55 for (let ii = arguments.length - 1; ii >= 0; ii--) {
56 head = {
57 value: arguments[ii],
58 next: head,
59 };
60 }
61 if (this.__ownerID) {
62 this.size = newSize;
63 this._head = head;
64 this.__hash = undefined;
65 this.__altered = true;
66 return this;
67 }
68 return makeStack(newSize, head);
69 }
70
71 pushAll(iter) {
72 iter = IndexedCollection(iter);

Callers

nothing calls this directly

Calls 1

makeStackFunction · 0.85

Tested by

no test coverage detected