- Queue data structure can be thought of as a container where records enter on one end and exit on the other
- Process of adding something to queue is something called 'Enqueuing or adding' , removing something from a queue is also called 'Dequeuing'
- Queue follows First In First Out principal
Before we go ahead and write a Queue we should understand the following concepts in JS
- Unshift method, adds something in front of the JS array
- Pop method , removes something from the end of the JS array
So the Queue basically limits access to so many options like shift, unshift, push, splice and slice in JS and only allows shift and pop.
Top comments (0)