Skip to content

Instantly share code, notes, and snippets.

@nelantone
Last active January 27, 2021 11:58
Show Gist options
  • Save nelantone/cb4920ad4a648c723e48ccb2945b511e to your computer and use it in GitHub Desktop.
Save nelantone/cb4920ad4a648c723e48ccb2945b511e to your computer and use it in GitHub Desktop.
a = ['a','b', 'c']
a.each do |b|
b.upcase! # upcase is not an array method so we use `b` instead a[1] = 'd'
a[1] = 'd'
end
p a # => ['Ad','d','Cd']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment