Falsy Values and how to Handle them with Logical OR and Nullish CoalescingLet's crack the egg!! First, let's understand the OG - Logical OR (| |) Logical OR operator (||) is used to set a default value for a variable in case it is "falsy" (i.e., evaluates to false, null, undefined, 0, NaN, or an empty string). If the firs...1AFeb 22, 2023 · 1 min readshushma.hashnode.dev
Mystery behind display of "undefined" in the ConsoleHave you also noticed "undefined" appearing on your Console when running certain methods or expressions and wondered why? Well, that's because the Console, which is a tool for debugging and inspecting the state of a web page is designed to display th...Feb 14, 2023 · 2 min readshushma.hashnode.dev
JS Debugging 101: Differentiating TypeError and ReferenceError"Errors come in all shapes and sizes, but at the end of the day, they all mean the same thing - time for some debugging!" A ReferenceError in JavaScript is when you try to use a variable or a function that hasn't been declared or defined yet. Think ...Feb 13, 2023 · 3 min readshushma.hashnode.dev
Fine line between'==' and '===' in JavaScriptHave you ever been confused about which comparison operator to use in JavaScript: == or ===? Read on to find out the difference between the two and why it matters. Imagine you have two boxes, each with a different toy inside. One box has a red car an...Feb 12, 2023 · 3 min readshushma.hashnode.dev