-
-
Save fables-tales/5181282 to your computer and use it in GitHub Desktop.
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
number = 1 | |
string = "andrew" | |
hash = { "foo" => "bar" } | |
array = [1,3,2] | |
symbol = :cheese | |
range = 1..3 | |
# try puts each variable above | |
puts string | |
def swap(argument1, argument2) | |
[argument2, argument1] | |
end | |
class Cheese < String | |
def reverse | |
'cheese' | |
end | |
end | |
cheese = Cheese.new('andrew') | |
cheese.reverse | |
10.times do |i| | |
puts i | |
end | |
[1,8,9,10].each do |thing_in_list| | |
puts thing_in_list+1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment