Came across an expression as
return !!current_user;
where current_user will be null unless user has logged in.
Mozilla docs mention that ! operation
Returns false if its single operand can be converted to true; otherwise, returns true.
Examples of expressions that can be converted to false are those that evaluate to null, 0, the empty string (""), or undefined.
|
A null value got converted to false.
Read more on stackoverflow here and here