A

Admin • 828.03K Points
Coach

Q. How do you create a hash (dictionary) in Ruby?

  • (A) { key1: 'value1', key2: 'value2' }
  • (B) [ key1 => 'value1', key2 => 'value2' ]
  • (C) ( key1: 'value1', key2: 'value2' )
  • (D) < key1: 'value1', key2: 'value2' >
  • Correct Answer - Option(A)
  • Views: 5
  • Filed under category Ruby
  • Hashtags:

Explanation by: Admin
Hashes in Ruby are created using curly braces with key-value pairs.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.