Understanding loose equality and strict equalityIntroduction Before understanding == and ===, let's take a look at how the conversion from one data type to other works behind the hoods! Type Conversion Type conversion: As the name suggests, it is the process of converting one type into another. Va...2VABFeb 21, 2023 · 3 min readrajashreeparhi.hashnode.dev
Nullish Coalescing and Optional ChainingIntroduction Prevention is better than cure! When we stumble on a scenario with a possibility of undefined or null, it's better to have a checkpoint than break the code! We can handle undefined/null in the following way, right? function printName(nam...1AFeb 19, 2023 · 3 min readrajashreeparhi.hashnode.dev
Why do we need an arrow function?Introduction Before ES6, there was only one way to write functions in JavaScript. function traditionalFunc(str){ console.log(str); } traditionalFunc("Hello"); //Hello What if you can write it more concisely? const arrowFunc = str => console.log(...1CFeb 18, 2023 · 3 min readrajashreeparhi.hashnode.dev
Errors in JavaScriptIntroduction Development and coding go hand in hand! We encounter errors on the Chrome browser console or in our terminal and there's no escape to it! It's good to be mindful of the errors that pop up because it would help us identify the root cause ...1GFeb 16, 2023 · 3 min readrajashreeparhi.hashnode.dev
Why does Chrome console.log always append a line saying 'undefined'?Introduction Have you noticed this behaviour when you type console.log() in the Chrome console window? You are getting two values here- Hello undefined The first output is the expected one but what about the second output? Any guess? It is becau...2SGFeb 14, 2023 · 2 min readrajashreeparhi.hashnode.dev