Examveda
Examveda

What is the correct syntax for creating a hash in Ruby?

A. {"key1": "value1", "key2": "value2"}

B. hash = {}

C. hash.add("key", "value")

D. Hash.new("key", "value")

Answer: Option A


This Question Belongs to Ruby Programming >> Basic Syntax In Ruby

Join The Discussion

Related Questions on Basic Syntax in Ruby