Double Question Marks TypeScript 3.7 - Nullish Coalescing

Double Question Marks TypeScript 3.7 - Nullish Coalescing

Double Question Marks TypeScript 3.7 - Nullish Coalescing. We explore what Nullish Coalescing, aka. the 'double question mark' operator means, and how you might use it in some real world use cases.

Hi folks. I wanted to take this opportunity to talk about one of the new features of TypeScript 3.7 which, conveniently, will also be included in vanilla JavaScript.

The feature is called Nullish Coalescing and it’s summed up here by the good folks at TypeScript. But if you’re a glutton for punishment, please read on.

Nullish Coalescing#

I’m sure we’d all appreciate a bit more coalescing in the world, but for now we can settle for it in our code. Exactly what is Nullish Coalescing and why do we need it?

The answer is, it’s similar to this:

const mayBeThisThingOrThisOtherThingIfNot = thisThing || thisOtherThing

but not exactly.

If you’re familiar with C# then you may have used these operators before and you can most likely tune out now and go and catch the latest episode of .

If you’re still here, let’s look at how operator in question differs from the above code. Well, for a start, you’d write it like this instead:

typescript javascript web-development programming

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Hire Dedicated eCommerce Web Developers | Top eCommerce Web Designers

Build your eCommerce project by hiring our expert eCommerce Website developers. Our Dedicated Web Designers develop powerful & robust website in a short span of time.

How long does it take to develop/build an app?

This article covers A-Z about the mobile and web app development process and answers your question on how long does it take to develop/build an app.

Learning JavaScript: Development Environments for JavaScript Programming

One of the nice things about learning JavaScript these days is that there is a plethora of choices for writing and running JavaScript code. In this article, I’m going to describe a few of these environments and show you the environment I’ll be using in this series of articles.