Normally, I compare a boolean value by simply putting it in if
statement as following:
var foo = 'Foo data';
if ( foo ) {
// Do somethings
}
Recently, I just saw some people convert the variable to boolean before comparing it:
if ( !!foo ) {
// Do somethings
}
Is there any different in term of performance or advantage? Which one is more preferable?