Pārlūkot izejas kodu

Add Pop wrapper function for stack

ApisNecros 2 gadi atpakaļ
vecāks
revīzija
82f7afdea1
1 mainītis faili ar 11 papildinājumiem un 0 dzēšanām
  1. 11 0
      starfish.js

+ 11 - 0
starfish.js

@@ -218,9 +218,20 @@ class Stack {
         this.register = null;
     }
 
+    /**
+     * Wrapper function for Array.prototype.push
+     * @param {*} newValue 
+     */
     Push(newValue) {
         this.stack.push(newValue);
     }
+    /**
+     * Wrapper function for Array.prototype.pop
+     * @returns {*}
+     */
+    Pop() {
+        return this.stack.pop();
+    }
 
     /**
      * Implement }