Splat operator Question

Hi there. What’s the functional difference between

pet1, pet2, pet3 = *[“duck”, “dog”, “cat”]

and

pet1, pet2, pet3 = [“horse”, “cow”, “goat”]

I get the same results–namely, each pet gets one value from the array.

This is a user comment in one post [1] in my blog

[1] :

Pedro Del G.

Email : [email protected]

This is a user comment in one post [1] in my blog

Sorry, i forget the address

[1] :
http://theplana.wordpress.com/2007/03/03/ruby-idioms-the-splat-operator/

Pedro Del G.

Email : [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs