πŸ“Š Ruby
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
πŸ’¬ Discuss
βœ… Correct Answer: (D) Both option2 and option3

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

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

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
49
Total Visits
πŸ“½οΈ
8 mo ago
Published
πŸŽ–οΈ
Rati Dubey
Publisher
πŸ“ˆ
88%
Success Rate