Thanks. But in this way, the stack can never get filled up, coz the array ain't static. I think different languages, have their different implementation of abstract structures. In java, you can't implement a stack with an array coz its fixed
You can always "fix" the array if you want by adding a size to the constructor. Then you check if the size is met whenever you push a new value to the stack. So yeah, the language can give you other constructs and other ways to do something, but it's totally possible to do it in JavaScript
Thanks. But in this way, the stack can never get filled up, coz the array ain't static. I think different languages, have their different implementation of abstract structures. In java, you can't implement a stack with an array coz its fixed
You can always "fix" the array if you want by adding a size to the constructor. Then you check if the size is met whenever you push a new value to the stack. So yeah, the language can give you other constructs and other ways to do something, but it's totally possible to do it in JavaScript
Thanks man