In javascript
I have seen the usage of
if (!!foo.bar) {
doSomething();
}
What is the performance and other differences between this and
if (Boolean(foo.bar)) {
doSomething();
}
?
Is there any overhead for the use of constructor typecasting over negation?
Another (better) example is:
doSomethingWithBoolean(!!foo.bar);