DEV Community

Discussion on: Stacks vs. Queues In JavaScript

Collapse
 
emmabostian profile image
Emma Bostian ✨

In all honesty, I'm not sure about the benefits. Previously, JS didn't have "class" syntax, therefore closures were necessary. But when the class keyword was released with ES6, I believe, that provided a new way to write this type of data structure.

Collapse
 
johnson_cor profile image
Corey Johnson

Oh! That's makes a lot of sense. I remember trying to do something similar to this using prototypes and it was not fun.