Skip to content

Instantly share code, notes, and snippets.

@kleinron
Created November 13, 2021 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kleinron/d3c066609fe7443808a897fbeadd0fc5 to your computer and use it in GitHub Desktop.
Save kleinron/d3c066609fe7443808a897fbeadd0fc5 to your computer and use it in GitHub Desktop.
class DynamicArrayQueue {
constructor() {
this._arr = [];
}
enqueue(item) {
this._arr.push(item);
}
dequeue() {
return this._arr.shift();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment