Learn Ruby_ Blocks and Sorting Cheatsheet _ Codecademy
Learn Ruby_ Blocks and Sorting Cheatsheet _ Codecademy
extra_curriculars("chess club",
"gymnastics", "anime club", "library
services")
#Output
#After school, I'm involved with chess
club
#After school, I'm involved with
gymnastics
#After school, I'm involved with anime
club
#After school, I'm involved with library
services
Ruby Return
In Ruby, the return keyword is used to pass back
a value from a method. def generous_tip(bill)
return bill * (0.25)
end
generous_tip(100) # 25
#Output
#"So am I!"
#"So am I!"
#"So am I!"
puts 3 <=> 3 # 0