What are common pitfalls with equality (== vs ===)?

Keywords: JavaScript, equality, comparison, == vs ===, type coercion, strict equality
Description: This article discusses common pitfalls in JavaScript's equality operators, specifically the differences between == and ===, and explains how type coercion can lead to unexpected results.
            // Example of using == (loose equality)
            console.log(0 == '0'); // true, because '0' is coerced to 0
            
            // Example of using === (strict equality)
            console.log(0 === '0'); // false, because no type coercion occurs
            
            // Further examples
            console.log(null == undefined); // true
            console.log(null === undefined); // false
            
            console.log(false == ''); // true
            console.log(false === ''); // false
        

Keywords: JavaScript equality comparison == vs === type coercion strict equality