Weekly tips

Squadracer shares a tip every week. We start this series in Ruby!

do...while

The do...while loop in Ruby exists

Alexandre Borderes
Alexandre Borderes

_

Underscore

Alexandre Borderes
Alexandre Borderes

Rightward assignment

The new assignment operator =>

Alexandre Borderes
Alexandre Borderes

tally

Count the number of occurrences

Alexandre Borderes
Alexandre Borderes

"a" + "b" << "c#{"d"}"

String concatenation

Alexandre Borderes
Alexandre Borderes

== vs === vs eql? vs equal?

Why so many methods of comparison?

Alexandre Borderes
Alexandre Borderes

Array and multiplication

The Array class redefines the `*` operator

Alexandre Borderes
Alexandre Borderes

flip-flop

The obscure conditional expression

Alexandre Borderes
Alexandre Borderes

pp

For "pretty print"

Alexandre Borderes
Alexandre Borderes