Subaashsubaash.hashnode.dev·Dec 17, 2023Redefine your Logic for stricter, safer JavaScript defaults with the '??' operatorThe title is not a clickbait. There exists an actual '??' operator in JavaScript known as the Nullish coalescing operator. This operator accepts operands on either side and returns the right-hand side operand only when the left-hand side operand is a...Discuss·1 likeJavaScript
Gaurav J Somanigaurav750.hashnode.dev·Oct 30, 2023Mastering TypeScript: Beyond the Basics with Interfaces, Generics, and MoreMany of us have already dabbled with the basic types TS provides and experienced the safety it provides. But Typescript, like an iceberg, has layers beneath its surface - features that can make our code more flexible, robust and maintainable. In this...Discuss·2 likes·46 readsTypeScript Generics
Dheeraj Malikdheerajmalik.hashnode.dev·Oct 30, 2023Nullish coalescing operator (??) vs OR(||)(raw notes)Nullish coalescing operator (??) if the left side operand is NULL or UNDEFINED, the right-hand side operand is returned.const foo = null ?? 'default string'; console.log(foo); // Expected output: "default string" Nullish values are : NULL ...DiscussNullish coalescing
Emerson Souzablog.lublot.dev·Jul 19, 2023Streamlining Nullish Value Handling in TypeScriptThe Nullish Coalescing Operator (??) is a feature introduced in TypeScript to handle the case of null or undefined values more effectively. It provides a concise way to check if a value is nullish and fallback to a default value if it is. Example Con...DiscussTypeScript
Sachin Kumareasily-explain.hashnode.dev·Jun 29, 2023Understanding Nullish Coalescing in JavaScript: A Beginner's GuideIntroduction: JavaScript is a versatile programming language that offers various features to handle different scenarios. One such feature is the nullish coalescing operator, denoted by ??. In this blog, we will explore what nullish coalescing is, how...Discuss·41 readsJavaScript
Dany ParedesProwww.danywalls.com·May 23, 2023Avoid Check Null or Undefined In Typescript using Optional Chaining and Nullish CoalescingTypeScript offers powerful features that make code more concise and efficient. Two such features, optional chaining and nullish coalescing, play a vital role in handling data effectively. In this article, we'll explore these features within the conte...Discuss·4 likes·748 readsTypescriptTypeScript
Luke Chidubemlukechidubem.hashnode.dev·Mar 31, 2023JavaScript Nullish Coalescing OperatorThe Nullish Coalescing Operator (??) is a relatively new addition to JavaScript, introduced in ECMAScript 2020. It provides a shorthand way of checking whether a value is null or undefined, and providing a default value if it is. The syntax of the Nu...Discuss·66 readsJavaScript
Phillippe Santanaphillcode.hashnode.dev·Mar 20, 2023The Ultimate Guide to Default Values in JavaScript: || and ?? Operators ExplainedOne of the most common tasks in JavaScript is providing default values for variables that may be falsy or nullish. Two operators that are commonly used for this are the logical OR (||) and the nullish coalescing (??) operators, but they definetely ar...Discuss·2.8K readsJavaScript
Soubhagya Sethysoubhagyasethy.hashnode.dev·Mar 18, 2023JavaScript's Nullish Coalescing Operator: A Beginner's GuideHey geeks! Have you ever encountered a situation where you need to check if a variable is null or undefined and then assign a default value to it? If yes, then the Nullish Coalescing Operator in JavaScript can make your code simpler and cleaner. Unde...Discuss·161 readsJavaScript
Bhushan Patilfrontendgenius.com·Mar 3, 202310 New JavaScript features to start using todayJavaScript is a widely used programming language in web development that continues to evolve with new features. By leveraging these features, developers can enhance their coding skills and increase productivity. In this article, we will explore eight...Discuss·175 readsJavascriptJavaScript