viernes, 9 de agosto de 2013

Little bits of knowledge I(false and nil)

 Little bits of knowledge I(false and nil)

Along with false, nil is one of two non-true values in Ruby. (Every other object is regarded as "truthy," meaning that if you were to type if 2 or if "bacon", the code in that if statement would be run.)

It's important to realize that false and nil are not the same thing: false means "not true," while nil is Ruby's way of saying "nothing at all."

variables that start with colons are symbols. symbols aren't strings
while there can be multiple different strings that all have the same value, there's only one copy of any particular symbol at a given time.

No hay comentarios:

Publicar un comentario