Javascript If Statement Double Exclamation Mark Operator Redundancy April 01, 2024 Post a Comment 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 (!!([])Solution 1: Yes. Both of these will print for any Boolean(x) === trueFor more detail, you can find truthy, falsy and Boolean in JavaScriptFor esier to understand, you can use Boolean([]) // true Share Post a Comment for "Javascript If Statement Double Exclamation Mark Operator Redundancy"
Post a Comment for "Javascript If Statement Double Exclamation Mark Operator Redundancy"