So I made a function to push user-inputted strings to a stack by using the built in .push(e) function like so:
push() {
const arrays = this.array.push(String(this.userInput))
console.log(this.array)
}
and with every click of the push button the console updates the array pushing whatever the user has inputted into an HTML text field which I have also made. I showed it to a friend and they told me that this method was sort of cheating as I'm making a Stack of stacks and that there is a way to...
Implement a Stack using only an index, a count, and an array.
Conceptually I know what these are, the index is an objects position in a given array, and an array is a collection of objects of the same variable types and a count is ostensibly a count (correct me if I'm wrong?). However tying these concepts together to implement a stack is a little beyond me as a first semester computer science student is there a lay-mans terms way of explaining how these things can be tied together to implement a stack?
pushis forbidden, or what?