Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
Different between !! and true javascript
Asked
May 11 '17 at 00:50
Active
Aug 06 '17 at 05:24
Viewed
40 times
1
What is different between it
if(hereIsTrue)
and
if(!!hereIsTrue)
javascript
edited Aug 06 '17 at 05:24
Cœur
37,241
25
195
267
asked May 11 '17 at 00:50
Nguyễn Bảo Dũng
235
2
12
There is no difference.
–
Felix Kling
May 11 '17 at 00:53
It's a double negative... it *should* be the same
–
Yonah Karp
May 11 '17 at 00:53
if `hereIsTrue` is "truthy" rather than `true`, then `!!hereIsTrue === true` but `hereIsTrue !== true` (note === and !== as opposed to == and !=)
–
Jaromanda X
May 11 '17 at 00:54
0 Answers
0