Skip to content

Instantly share code, notes, and snippets.

@osha7
Last active February 28, 2021 00:42
Show Gist options
  • Save osha7/230879c902e17b8c2e7a9a10eba9c6d5 to your computer and use it in GitHub Desktop.
Save osha7/230879c902e17b8c2e7a9a10eba9c6d5 to your computer and use it in GitHub Desktop.
queue - 1
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