Skip to content

Instantly share code, notes, and snippets.

@alexesca
Created July 2, 2020 22:43
Show Gist options
  • Save alexesca/43c31bacf69f915c6fd4a965aea237bd to your computer and use it in GitHub Desktop.
Save alexesca/43c31bacf69f915c6fd4a965aea237bd to your computer and use it in GitHub Desktop.
/* Stack the shows the progression of the LIFO thinking */
console.clear()
const array = [];
console.log("Initial array ",array)
console.log("Push 1: ", array.push(1))
console.log("Push 2: ", array.push(2))
console.log("Push 3: ", array.push(3))
console.log("Array ", array)
console.log("Pop 1: ", array.pop())
console.log("Array ", array)
console.log("Pop 2: ", array.pop())
console.log("Array ", array)
/* End of example */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment