Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Learn Dart in 15 Minutes. Parent comment
The Angular team, for instance, has defined toBool() (which they use in directives like ng-if) like this:
bool toBool(x) { if (x is bool) return x; if (x is num) return x != 0; return false; }
There are no comments on this comment yet.
The Angular team, for instance, has defined toBool() (which they use in directives like ng-if) like this:
It treats true and non-zero numbers as true, and everything else (including null) as false.