Created
January 27, 2020 15:45
-
-
Save zaagan/befe5adb0adad797c0e97f7b6aab54b3 to your computer and use it in GitHub Desktop.
Ruby Basics - If Else
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
response = :greeting | |
# If Statement | |
if response == :greeting | |
puts "Hello !" | |
end | |
# Good | |
if response == :greeting then puts "Hello !" end | |
# Better | |
puts "Hello !" if response == :greeting |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment