1 minute read

Almost 3 hours of review vidoes watched tonight. On thing that I think can be very useful to all. A double bang !! converts an object to it’s truthy value. For example:

seth@seth-u:~$ irb
2.4.0 :001 > 1
 => 1
2.4.0 :002 > !1
 => false
2.4.0 :003 > !!1
 => true

So the return value of 1 is 1 we know 1 has a boolean value of true. So !1 is false and thus !!1 is true. This can be useful for obvious reasons.

Time spent today: 2:41
Time spent total: 135:13
Lessons completed today: 3
Lessons completed total: 325

comments powered by Disqus