Beginner Ruby
Q9 / 100

How do you create a hash (dictionary) mapping "name" to "Alice"?

Correct! Well done.

Incorrect.

The correct answer is A) {"name" => "Alice"} or {name: "Alice"}

A

Correct Answer

{"name" => "Alice"} or {name: "Alice"}

Explanation

Ruby hashes can be created with the "key => value" syntax or, for symbol keys, the shorthand "key: value" syntax.

Progress
9/100