is it right to assigning multiple variable like this a = b = c = d = 5 in ruby?

Posted by Salil on Stack Overflow See other posts from Stack Overflow or by Salil
Published on 2010-05-28T13:30:02Z Indexed on 2010/05/28 14:11 UTC
Read the original article Hit count: 364

Filed under:
|
|
|
a = b = c = d = 5

puts (a) >> 5
puts (b) >> 5
puts (b) >> 5
puts (b) >> 5
a= a+1
puts (a) >> 6
puts (b) >> 5

i found there is no problem with the assigning value like this. my question is should one assign like the one given above or

a , b, c, d = 5, 5, 5, 5

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby