I have some concerns about my code. What approach in JavaScript is preferential when conversion to the boolean value needed? Boolean(2) or !!2?
Asked
Active
Viewed 57 times
0
-
the first one has only one type check. – Nina Scholz Dec 24 '18 at 15:17
-
1You can find this out for yourself. https://jsperf.com/ – jmargolisvt Dec 24 '18 at 15:17