Precedence
By Jiazhen Xie | 27 October 2013
Tags: ruby, programming, advanced
Today when practised Ruby, I encountered an issue about precedence. Common sense Let's start with simple exercise, the old fashion statement is as below And we can also shorten to . Easy right? Please look at the next example. Dictionary Class If we do I was expecting the result is nil. But it returns false and throws warning . What is it?? Investigation In Ruby, if on a non-boolean input will check existence, the check for existence with ?? considered true; you receive a warning (warning: strin...
← Back to Home