Answers for "create a new hash from existing hash ruby"

3

how to make a new hash ruby

my_hash = Hash.new #=> { }
# OR
my_hash = {}
Posted by: Guest on June-11-2020
0

create a new hash from existing hash ruby

data = {name: 'akshay', last_name: 'kakade'}
new_hash = Hash[data]
data.object_id
new_hash.object_id
Posted by: Guest on October-15-2021
0

ruby assign value to hash

grades = Hash.new
grades["Dorothy Doe"] = 9
Posted by: Guest on June-24-2020

Browse Popular Code Answers by Language