A

Admin • 828.03K Points
Coach

Q. Which of these is the correct way to define a symbol-to-string hash key?

  • (A) { 'key' => 'value' }
  • (B) { key: 'value' }
  • (C) { :key => 'value' }
  • (D) Both option2 and option3
  • Correct Answer - Option(D)
  • Views: 8
  • Filed under category Ruby
  • Hashtags:

Explanation by: Admin
Ruby supports both new and old syntax for symbol keys.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.