Get the latest tech news

Ruby 3.4, No More TypeError with **Nil as It Is Treated as an Empty Hash


When double splat ** operator used with nil, it is treated similarly to **{}, which passes no keywords and does not call any conversion methods.

The Single Splat operator (*) constructs and spreads out Arrays. The double Splat operator (**) It works similarly. When**nil is used, it is treated similarly to**{}, which passes no keywords and does not call any conversion methods.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of ruby

ruby

Photo of typeerror

typeerror

Photo of hash

hash

Related news:

News photo

Choosing the Right Audit Trail Approach in Ruby

News photo

Ruby might be faster than you think

News photo

Should You Use Ruby on Rails or Hanami?