Created
July 14, 2016 00:50
-
-
Save arpit/ba91a46c7147eeaca5f20269f0659e03 to your computer and use it in GitHub Desktop.
Array basics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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