If I have an if statement that doesn't have a conditional operator, does it matter if I use the double exclamation mark operator - !!
?
For example...
if ([]) {
}
vs...
if (!!([])) {
}
From what I understand - the operator is basically asking - "is this value truthy?". So it is redundant in this case. Is it redundant in all cases similar to this?
EDIT:
if (x) { console.log("hi"); }
if (!!x) { console.log("hi"); }
Will both of these print for any x
? That is my question.