Last active
February 28, 2021 00:42
-
-
Save osha7/230879c902e17b8c2e7a9a10eba9c6d5 to your computer and use it in GitHub Desktop.
queue - 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const queue = [] | |
// add items to the queue: | |
queue.push('strength') | |
queue.push('invisibility') | |
queue.push('shapeshifting') | |
queue.push('teleportation') | |
queue | |
// ==> ['strength', 'invisibility', 'shapeshifting', 'teleportation'] | |
// remove items from the queue: | |
queue.shift() | |
queue | |
// ==> ['invisibility', 'shapeshifting', 'teleportation'] | |
queue.shift() | |
queue | |
// ==> ['shapeshifting', 'teleportation'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment