It's the nullish coalescing operator that has been proposed for ecmascript and has been implemented in Typescript. You can read more in the Github issue for its implementation or the JavaScript documentation on MDN.

The gist of it is that

const dealType = currentDealType ?? originalDealType;

is equivalent to:

const dealType = currentDealType !== null && currentDealType !== void 0 ? currentDealType : originalDealType;

Or in words: if currentDealType is null or undefined use originalDealType otherwise use currentDealType

Answer from Titian Cernicova-Dragomir on Stack Overflow
🌐
Medium
medium.com β€Ί @teamcode20233 β€Ί understanding-double-question-mark-operator-in-typescript-be869f210fe6
Understanding Double Question Mark Operator (??) in TypeScript | by Teamcode | Medium
July 3, 2023 - When we use the double question mark operator (??) to assign a default value to displayName, it checks if name is null or undefined. Since name is null, the default value β€œGuest” is assigned to displayName.
🌐
Tim Mousk
timmousk.com β€Ί blog β€Ί typescript-double-question-mark
How To Use The Double Question Mark Operator In TypeScript? – Tim Mouskhelichvili
March 6, 2023 - The double question mark operator or nullish coalescing operator helps assign a default value to a null or undefined TypeScript variable.
🌐
Reddit
reddit.com β€Ί r/javascript β€Ί new nullish coalescing (?? double question mark ) operator in typescript & javascript
r/javascript on Reddit: New Nullish Coalescing (?? Double question mark ) Operator in Typescript & Javascript
May 12, 2019 - Yes, typescript counts. Please keep self promotion to a minimum/reasonable level. ... It's very recent, it was moved to stage 4 (Finished) 5 months ago https://github.com/tc39/proposal-nullish-coalescing ... Wow, I just typed in this search on duckduckgo "double question mark typescript" after reading some source code from GitHub...
🌐
Becomebetterprogrammer
becomebetterprogrammer.com β€Ί typescript-double-question-marks
TypeScript | Double Question Marks (??) - What it Means
Similar to object-oriented languages like Java and C#, now TypeScript developers can use various object-oriented features like interfaces, inheritance, … Read more ... The other day I wrote an article about the dereference unary operator (*) and I needed a way to explain the unary operator ...
🌐
Thrive My Way
thrivemyway.com β€Ί home β€Ί javascript libraries β€Ί typescript – double question marks (??) explained
TypeScript - Double Question Marks (??) Explained - Learn Digital Marketing
January 5, 2023 - In TypeScript, the double question mark (??) is known as the nullish coalescing operator. It is used to provide a default value for a variable that may be
Find elsewhere
🌐
Eran Stiller
eranstiller.com β€Ί javascript-double-question-marks
What Is the JavaScript Double Question Marks (??) Operator?
September 24, 2023 - It helps handle null or undefined values seamlessly, assigning default values and preventing unexpected behaviors. Coupled with the optional chaining operator, it ensures safe access to object properties.
🌐
DEV Community
dev.to β€Ί danywalls β€Ί simplify-your-typescript-code-with-optional-chaining-and-nullish-coalescing-37on
Simplify Your Typescript Code with Optional Chaining and Nullish Coalescing - DEV Community
May 23, 2023 - The double question mark (??) checks if the left-hand side value is nullish (null or undefined) and provides the right-hand side value as the default if needed. Nullish coalescing ensures that we always have a valid jersey number, even if it's ...
🌐
Angular.love
angular.love β€Ί double-question-marks-typescript-3-7-nullish-coalescing
Double Question Marks TypeScript 3.7 - Nullish Coalescing
That pretty much wraps up the explanation on this handy little operator. We already had a similar one in ||, but this one takes care of the few edge cases highlighted here, when valid values overlap the conditions covered by the || operator.
🌐
DEV Community
dev.to β€Ί emilossola β€Ί understanding-double-question-mark-operator-in-typescript-10a1
Understanding Double Question Mark Operator (??) in TypeScript - DEV Community
July 3, 2023 - The syntax for using the double question mark operator is value1 ?? value2, where value1 is the expression to be evaluated and value2 is the fallback value to be used if value1 is null or undefined. This operator helps to simplify conditional checks and provides a more streamlined approach to handling nullish values in TypeScript code.
🌐
SkillReactor Blog
skillreactor.io β€Ί home β€Ί double question mark javascript operator explained
Double Question Mark JavaScript Operator Explained - SkillReactor Blog
July 8, 2024 - When used in TypeScript, the double question mark operator serves the same purpose as in JavaScript – nullish coalescing. It allows developers to efficiently handle null and undefined values, providing fallback options when necessary.
🌐
Lightly-dev
lightly-dev.com β€Ί blog β€Ί typescript-double-question-mark
What is Double Question Mark (??) in TypeScript? - Lightly
In TypeScript, the double question mark (??) is the nullish coalescing operator used to provide a default value when a variable is null or undefined.
🌐
Webdevtutor
webdevtutor.net β€Ί blog β€Ί typescript-syntax-double-question-mark
Mastering TypeScript Syntax: The Double Question Mark Trick
Also known as the "optional chaining" operator, it allows you to safely access nested properties without causing runtime errors. The double question mark operator is used for optional chaining. It checks if the left-hand operand is null or undefined before accessing its property or method.
🌐
xjavascript
xjavascript.com β€Ί blog β€Ί typescript-double-question-mark
Understanding the TypeScript Double Question Mark (`??`) Operator β€” xjavascript.com
One of the useful features introduced in TypeScript (and ECMAScript 2020) is the nullish coalescing operator, represented by the double question mark (`??`). This operator provides a concise way to handle null or undefined values, offering more ...
🌐
TypeScript
typescriptlang.org β€Ί docs β€Ί handbook β€Ί release-notes β€Ί typescript-3-7.html
TypeScript: Documentation - TypeScript 3.7
At its core, optional chaining lets us write code where TypeScript can immediately stop running some expressions if we run into a null or undefined. The star of the show in optional chaining is the new ?. operator for optional property accesses.
🌐
Sonar Community
community.sonarsource.com β€Ί sonarqube cloud
TypeScript 3.7 Nullish Coalescing Operator `? ?` (Double question marks) - SonarQube Cloud - Sonar Community
April 22, 2020 - We’re seeing errors during the Azure DevOps Code Analysis step on TypeScript files. Example error: ##[error]ERROR: Failed to parse file [filename removed] at line 126: Expression expected. Looking at the file/line number, our code shows: this.lapsedServicers = response ?? new PagedResponse(); It seems the SonarCloud analyizer is getting tripped up on the new ?? nullish coaleascing operator which was added in TypeScript 3.7 – https://github.com/microsoft/TypeScript/pull/32883 Do we know whe...
🌐
Webdevtutor
webdevtutor.net β€Ί blog β€Ί typescript-what-is-double-question-mark
Understanding the Mysterious Double Question Mark in TypeScript - "??"
The double question mark operates by checking both sides of the operator for nullability. Here's a step-by-step breakdown: Evaluate the left-hand side (LHS) expression. If the LHS is null or undefined, evaluate the right-hand side (RHS) expression. Return the value from either the LHS or RHS, ...