Last active
January 1, 2016 16:59
-
-
Save beezeebly/8173981 to your computer and use it in GitHub Desktop.
Ruby pop and push explained
This file contains hidden or 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
authors = ["Arthur Conan Doyle", "J.K. Rowling", "J.R.R. Tolkien", "Hanif Kureishi"] | |
authors.push("Neil Gaiman") | |
authors # => ["Arthur Conan Doyle", | |
# "J.K. Rowling", | |
# "J.R.R. Tolkien", | |
# "Hanif Kureishi", | |
# "Neil Gaiman"] | |
authors.pop() | |
authors # => ["Arthur Conan Doyle", | |
# "J.K. Rowling", | |
# "J.R.R. Tolkien", | |
# "Hanif Kureishi"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment