# Comma used to separate keys and values in hash literals until 1.9

**URL:** <https://www.ruby-forum.com/t/comma-used-to-separate-keys-and-values-in-hash-literals-until-1-9/260289>\
**Category:** Uncategorized\
**Created:** [September 24, 2020, 11:02pm UTC](https://www.ruby-forum.com/t/comma-used-to-separate-keys-and-values-in-hash-literals-until-1-9/260289 "2020-09-24T23:02:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgomo3](https://www.ruby-forum.com/user_avatar/www.ruby-forum.com/jgomo3/32/950_2.png) [@jgomo3](https://www.ruby-forum.com/u/jgomo3)\
**Post date:** [September 24, 2020, 11:02pm UTC](https://www.ruby-forum.com/t/comma-used-to-separate-keys-and-values-in-hash-literals-until-1-9/260289/1 "2020-09-24T23:02:21Z")

</div>

I’m reading “Programming Ruby 1.9 & 2.0” and there is a footnote that states:

“As of Ruby 1.9, a comma may no longer be used to separate keys and values in hash literals. A comma still appears between each key/value pair”.

So: how was that before 1.9? How was a comma used before to separate keys and values in hash literals?

---

<div class="post-metadata">

**Author:** ![SouravGoswami](https://www.ruby-forum.com/user_avatar/www.ruby-forum.com/souravgoswami/32/2543_2.png) [@SouravGoswami](https://www.ruby-forum.com/u/SouravGoswami)\
**Post date:** [September 25, 2020, 7:51am UTC](https://www.ruby-forum.com/t/comma-used-to-separate-keys-and-values-in-hash-literals-until-1-9/260289/2 "2020-09-25T07:51:10Z")

</div>

I am not sure, but looks like this was the syntax:

```ruby
> Hash['a', 100, 100, 200, true, false, nil, 'something']
=> {"a"=>100, 100=>200, true=>false, nil=>"something"}

```

> **[Class: Hash (Ruby 1.8.6)](https://ruby-doc.org/core-1.8.6/Hash.html)**
>
> Class : Hash - Ruby 1.8.6

But this syntax works till date…
