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
a = 'hello' | |
b = a | |
a = 'goodbye' |
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
a = 'hello' | |
b = a | |
a = 'goodbye' |
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
a = 4 | |
loop do | |
a = 5 | |
b = 3 | |
break | |
end | |
puts a | |
puts b |
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
a = 4 | |
b = 2 | |
loop do | |
c = 3 | |
a = c | |
break | |
end | |
puts a |
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
a = 4 | |
b = 2 | |
2.times do |a| | |
a = 5 | |
puts a | |
end | |
puts a | |
puts b |
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
a = 4 | |
b = nil | |
loop do | |
a = 5 | |
b = 3 | |
break | |
end | |
puts a |
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
a = 4 | |
b = 2 | |
2.times do |_| | |
a = 5 | |
puts a | |
end | |
puts a | |
puts b |
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
a = 'hello' | |
puts a # -> hello | |
puts a.object_id # -> 70368527757720 (this number will be different for you) | |
a.upcase! | |
puts a # -> HELLO | |
puts a.object_id # -> 70368527757720 (this number will be the same as the one above) |
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
a = 'hello' | |
puts a # -> hello | |
puts a.object_id # -> 70368468160540 (this number will be different for you) | |
a.upcase | |
puts a # -> hello | |
puts a.object_id # -> 70368468160540 (this number will be the same as the one above) |
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
a = 'name' | |
b = 'name' | |
c = 'name' | |
# Are these three local variables pointing to the same object? | |
puts a.object_id | |
puts b.object_id |
OlderNewer