Skip to content

Instantly share code, notes, and snippets.

@arpit
Created July 14, 2016 00:50
Show Gist options
  • Save arpit/ba91a46c7147eeaca5f20269f0659e03 to your computer and use it in GitHub Desktop.
Save arpit/ba91a46c7147eeaca5f20269f0659e03 to your computer and use it in GitHub Desktop.
Array basics
# arr.each_with_index do |value, index|
# arr[index] = value * 2
# end
(0..arr.length - 1).each do |v|
arr[v] = arr[v] * 2
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment