How does JS type coercion work?

“0” is a string containing the character 0, it is not the numeric value 0. The only string-type value which evaluates to false is “”. “0” is truthy. Section 9.2 of the ECMAScript 262 specification defines how different types are converted to Boolean: Argument Type Result Undefined false Null false Boolean The result equals the … Read more