Closed andywaplinger closed 6 years ago
Double so that it can also catch undefined
.
!undefined; // true
!null; // true
let a = undefined;
a == null; // true
a == undefined; // true
!minutes
should work perfectly though.
Ok, I believe I've got it. minutes
is being converted to a boolean when putting !
in front. And at 0 minutes, !0
means not false
which is true
, and so it selects the first if statement.
By instead just catching null
, it's comparing 0 to null, which is false
, so it goes to the next statement 0 === 0
.
Is it suppose to be double equals or triple equals?