def scream!(string)
string.upcase!
end
names = ['James Bond', 'Blofeld', 'M', 'Strawberry Fields']
names.each do |name|
puts scream!(name)
end
This code logs:
JAMES BOND
BLOFELD
STRAWBERRY FIELDS
Why is M missing?
JAMES BOND
BLOFELD
STRAWBERRY FIELDS
Why is M missing?
1 Response
Write a comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.