DEV Community

Discussion on: Stacks vs. Queues In JavaScript

Collapse
 
konrud profile image
Konstantin Rouda

I think that the description is wrong here it should be swapped and be changed to queue as we are implementing queue here and not the stack.

enqueue(item): Remove the top item from the stack
dequeue(): Add an item to the top of the stack

that is it should be set like so (and it should be changed to queue, instead of the stack)

enqueue(item): Add an item to the top of the queue
dequeue(): Remove the top item from the queue

Collapse
 
emmabostian profile image
Emma Bostian ✨

Copy paste ftw