In Javascript, is there any difference between
if(!!isLoaded) and if(Boolean(isLoaded))?
I recently started working on an app where the previous developer did this a lot.
I ran a few tests and they both seem to convert strings "true" and "false" to the Boolean type, which I'm assuming is the main reason for doing this.
If they are indeed the same, what is everyone's opinion on which one is more readable?
"true"and"false"to the boolean valuetrue. But yes, they do precisely the same thing.if(isLoaded)which I think is most readable.ifstatement, there's no point because the evaluation of theifcondition will do exactly the same thing anyway.