Skip to content

Instantly share code, notes, and snippets.

@zgfif zgfif/square.rb

Created Dec 26, 2018
Embed
What would you like to do?
ar = [1, 2, 4]
def square_values array
array.map! {|e| e * e }
end
p square_values ar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.