0
Plz explain this
function ex(){ Return !!2; } Console.log(ex())
2 Answers
+ 4
! Will convert the operand to boolean first, hthe rule is any object that is null, undefined,NaN, false, 0, -0, or empty string will be false else its true.
In this cas is 2 so it'll be true
!!2 -> !!true -> !false -> true
0
thanks