Created
January 27, 2014 15:14
-
-
Save alekst/8650152 to your computer and use it in GitHub Desktop.
unless
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
irb(main):001:0> array = ["a", "b", "c"] | |
=> ["a", "b", "c"] | |
irb(main):002:0> unless array[0] == "b" | |
irb(main):003:1> array << "d" | |
irb(main):004:1> end | |
=> ["a", "b", "c", "d"] | |
irb(main):005:0> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment