MCPcopy
hub / github.com/trekhleb/javascript-algorithms / push

Method push

src/data-structures/stack/Stack.js:35–39  ·  view source on GitHub ↗

* @param {*} value

(value)

Source from the content-addressed store, hash-verified

33 * @param {*} value
34 */
35 push(value) {
36 // Pushing means to lay the value on top of the stack. Therefore let's just add
37 // the new value at the start of the linked list.
38 this.linkedList.prepend(value);
39 }
40
41 /**
42 * @return {*}

Callers 15

isValidFunction · 0.95
topologicalSortFunction · 0.95
toArrayMethod · 0.80
addMethod · 0.80
addMethod · 0.80
addMethod · 0.80
findMethod · 0.80
Stack.test.jsFile · 0.80
createStoreMethod · 0.80
toArrayMethod · 0.80
reverseMethod · 0.80

Calls 1

prependMethod · 0.45

Tested by 2

traversalCallbackFunction · 0.64
traversalCallbackFunction · 0.64