+ 1
why (!null) is true?
if(!null) echo "true"; else echo "false"; //output : true
3 ответов
+ 21
Default boolean value of null is false and ! converts it to true
+ 4
Think of ! as "is not", it helps (that's how CoffeeScript works too, and I love it). So, this:
if(!null)
Means:
if is not null
+ 2
thanks.