vendredi 29 mai 2015

Difference between a || a = b and a = a || b in ruby?

Can anyone put light on this expression. Seems like both are same but they are not.

a || a = b or a ||= b

and

a = a || b

if

a = 4 and b = 6, output is always 4

This always confuse and misconcept me. Can someone please explain it?

Aucun commentaire:

Enregistrer un commentaire