devanthe.dev

puts Happy Birthday

1 min read

Today I'm turning 24. Nearly to a quarter of a century. I'm having some fun with celebrating.

Happy Birthday in Ruby:

1for i in 1...4
2 puts "Happy Birthday to You!" if i != 3
3 puts "Happy Birthday dear Devan" if i == 3
4end

Or for those who want it in JavaScript:

1for (var i = 0; i <= 3; i++) {
2 msg = i == 2 ? 'Happy Birthday dear Devan' : 'Happy Birthday to You!'
3 alert(msg)
4}