Skip to content

Latest commit

 

History

History
1 lines (1 loc) · 409 Bytes

File metadata and controls

1 lines (1 loc) · 409 Bytes

This repository contains a JavaScript code example demonstrating an uncommon error related to null checks. The foo function throws an error if either a or b is null. However, this check is overly strict, as it also throws an error when a or b is 0 (a falsy value). This unexpected behavior can be addressed by using the strict equality operator (===) instead of the loose equality operator (==).