Created
October 2, 2017 19:26
-
-
Save j3ck/f0aeadc8b0ce05a0fe5a677fbb33b7ac 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
#1 | |
a = [2,3,5,6,12] | |
for i in a | |
if i.even? == true | |
puts i | |
end | |
end | |
#2 | |
a = [2,3,5,6,12] | |
for i in a | |
if i.even? | |
puts i | |
end | |
end | |
#3 | |
a = [2,3,5,6,12] | |
for i in a | |
puts i if i.even? | |
end | |
#4 | |
a = [2,3,5,6,12] | |
a.each { |i| puts i if i.even? } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment