fork download
  1. myHash = Hash.new["key1" => "value1", "key2" => "value2", "key3" => "value3"]
  2.  
  3. puts "#{myHash}"
  4.  
  5. #Prints nothing but a new line to the screen "the \n is becuase of the puts method"
  6.  
  7. myHash1 = ["key1" => "value1", "key2" => "value2", "key3" => "value3"]
  8.  
  9. puts "#{myHash1}"
  10.  
  11. #prints the hash to the screen.
  12.  
  13. # Why does the first way not add the hash to myHash? but the second way does?
Success #stdin #stdout 0.01s 7456KB
stdin
Standard input is empty
stdout
[{"key1"=>"value1", "key2"=>"value2", "key3"=>"value3"}]