Truthy & Falsy Values
What is the result of !!'0' in JavaScript?
The result of !!'0' is true. The double negation (!!) is a common idiom in JavaScript to convert a value to its boolean equivalent. The string '0' is a non-empty string, which is truthy in JavaScript. When the first ! operator is applied, it converts '0' to a boolean and negates it, resulting in false. Then the second ! negates false, giving true. This is equivalent to Boolean('0'). It's worth noting that while the number 0 is falsy, the string '0' is truthy, which can be a source of confusion when working with user input or data conversion.