DEV Community

Discussion on: How to create a Stack using JavaScript

Collapse
shane325 profile image
Shane Barry

You can turn your empty() method into a one liner

empty() {
     return this.data.length === 0;
}
Enter fullscreen mode Exit fullscreen mode
Collapse
jrestrepo922 profile image
Juan Restrepo Author

Will be using this from now on. Thanks, Shane.