RBRakshith Bhatinrakshith.hashnode.dev·Jul 22, 2022 · 4 min readDeep copy vs Shallow copy in JavascriptPrerequisites Primitive values and Reference values. Different ways to copy values in Javascript Using the spread ... operator. Using the Object.assign() method. Using the JSON.stringify() and JSON.parse() methods. Let's look at how we copy objec...00
RBRakshith Bhatinrakshith.hashnode.dev·Jul 22, 2022 · 3 min readHow nullish coalescing operator works '??'Syntax The nullish coalescing operator is written as two question marks ?? It was introduced very recently as part of ES2020. How does it work? firstValue ?? secondValue It accepts two values and returns the secondValue if the firstValue is null ...00
RBRakshith Bhatinrakshith.hashnode.dev·Jul 22, 2022 · 4 min readWhat is useRef? And what are it's use cases?Prerequisites Basic knowledge of react hooks (useState, useEffect). General understanding of react works. What is useRef? useRef is a React hook which takes an initial value and returns a mutable ref object. Syntax of useRef: const myRef=useRef(ini...00