DEV Community

n350071🇯🇵
n350071🇯🇵

Posted on

 

Ruby array multiple assignment

Assignment to variables

a, b = [:hello, :world]
puts a #=> :hello
puts b #=> :world

Assignment as arguments ( 2 Ways )

def show_two_arguments(a,b:)
  puts a
  puts b
end

show_two_arguments(:hello, b: :world)
#=> :hello
#=> :world

show_two_arguments(*[:hello, b: :world])
#=> :hello
#=> :world

🔗 Parent Note

Top comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git