Alternative Syntax of Ruby Hashes

Hashes variant 1

cars = { “car1” => “avanza”, “car2” => “innova”, “car3” => “mirage” }

Hashes variant 2

cars = {  :car1 => “avanza”,  :car2 => “innova”,  :car3 => “mirage” }

Hashes variant 3

cars = {  car1: “avanza”,  car2: “innova”,  car3: “mirage” }

 

These are as far as i know.

Leave a Reply

Your email address will not be published. Required fields are marked *