Created
December 6, 2013 01:32
-
-
Save nixsticks/7817200 to your computer and use it in GitHub Desktop.
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
| string1 = "arrays are mutable" | |
| string2 = "and so are strings" | |
| string3 = "did you know?" | |
| array1 = [string1, string2, string1] | |
| array1[0] << " and so are strings" | |
| array1 | |
| # You're probably expecting array1 to return ["arrays are mutable and so are strings", "and so are strings", "arrays are mutable"], right? | |
| # NOPE. The result is: | |
| [ | |
| [0] "arrays are mutable and so are strings", | |
| [1] "and so are strings", | |
| [2] "arrays are mutable and so are strings" | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment