From ad36b5924a87af33b1c3edb37bcda8b7b3bba7a2 Mon Sep 17 00:00:00 2001 From: heehminh Date: Sat, 7 Jan 2023 22:47:15 +0900 Subject: [PATCH] FIX multiple elements to push to STACK --- src/js/data-structures/stack-array.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/data-structures/stack-array.js b/src/js/data-structures/stack-array.js index 1491eb2c..21dc5d98 100644 --- a/src/js/data-structures/stack-array.js +++ b/src/js/data-structures/stack-array.js @@ -5,8 +5,10 @@ export default class StackArray { this.items = []; } - push(element) { - this.items.push(element); + push() { + for (let i in arguments) { + this.items.push(arguments[i]); + } } pop() {