I am trying to use some Booleans
When doing as I do with other languages: eg Java
if(varName){}
But when doing it in Javascript it doesn't work as I want
Is it always necessary to do if(varName == true)?
Or is there a way to just do if(varName) ?
var b1 = Boolean('true');
var b2 = Boolean('false');
if (b1 && b2) {
console.log("entro al if")
}
if (b1) {
console.log("entro al if")
}
if (b2) {
console.log("entro al if")
}
if (b2 == false) {
console.log("entro al if")
}