Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Store multiple arrays under separate hash keys

item_array=["item 1", "item 2", "item 3", "item 4"]
thing_array=["thing 1", "thing 2", "thing 3", "thing 4", "thing 5"]
vox_array=["vox 1", "vox 2", "vox 3", "vox 4", "vox 5"]
multi_array_hash={"item key" => item_array, "thing key" => thing_array, "vox key" => vox_array}

puts item_array
puts
puts thing_array
puts
puts vox_array
puts 
puts multi_array_hash ["item key"]
puts 
puts multi_array_hash ["thing key"]
puts 
puts multi_array_hash ["vox key"]
puts 
puts multi_array_hash

puts multi_array_hash ["item key"], multi_array_hash ["vox key"]

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.