Kaynağa Gözat

Add Pop wrapper function for stack

ApisNecros 2 yıl önce
ebeveyn
işleme
82f7afdea1
1 değiştirilmiş dosya ile 11 ekleme ve 0 silme
  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 }