Called "optional chaining", it's currently a TC39 proposal in Stage 4. A Babel plugin however is already available in v7.

Example usage:

const obj = {
  foo: {
    bar: {
      baz: 42,
    },
  },
};

const baz = obj?.foo?.bar?.baz; // 42

const safe = obj?.qux?.baz; // undefined
Answer from Brent L on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › Optional_chaining
Optional chaining (?.) - JavaScript | MDN
The optional chaining (?.) operator accesses an object's property or calls a function. If the object accessed or function called using this operator is undefined or null, the expression short circuits and evaluates to undefined instead of throwing an error.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › Nullish_coalescing
Nullish coalescing operator (??) - JavaScript | MDN
The nullish coalescing operator treats undefined and null as specific values. So does the optional chaining operator (?.), which is useful to access a property of an object which may be null or undefined.
Discussions

CSS instead of using JS ternary operator to check for null/empty values before adding a "%" or prepending a "$"
Why not make a filter? More on reddit.com
🌐 r/javascript
53
35
March 3, 2016
[AskJS] Nullish Check in conditional
value == null only matches null and undefined, not any other falsy values. This is the only time you should use == over ===. More on reddit.com
🌐 r/javascript
23
7
August 16, 2024
[AskJS] JavaScript operators like or ( || ), and ( && ), null coalescing ( ?? ) makes weak comparasion?
The difference between || and ?? is that ?? runs the right part only when the left part is null or undefined whereas || runs the right part when the left part is a falsey value (falsey values include nulland undefined). More on reddit.com
🌐 r/javascript
13
0
April 13, 2024
Thoughts on the Null Coalescing (??) operator precedence?
When something relatively new comes out, it's common for the first few games in town to foul up the artistry. Wirth is a towering intellect in this field, but he screwed up the precedence tables in Pascal. Experience will highlight mistakes, and then it's eventually time to design a new language. ?? clearly goes after function-call and field-access, but before arithmetic. The field-access counterpart .? should be on the same level as non-null field-access .. More on reddit.com
🌐 r/ProgrammingLanguages
11
31
April 30, 2024
🌐
Built In
builtin.com › software-engineering-perspectives › javascript-null-check
How to Check for Null in JavaScript | Built In
To check if contact is, in fact, null rather than simply undefined, use the strict equality operator to compare the result to null and undefined. A tutorial on how to check for null and undefined in JavaScript.
🌐
freeCodeCamp
freecodecamp.org › news › javascript-advanced-operators
Advanced JavaScript Operators – Nullish Coalescing, Optional Chaining, and Destructuring Assignment
January 4, 2024 - This operator is also known as the nullish coalescing operator. It’s a new feature introduced in JavaScript ES2020 that allows you to check for null or undefined values in a more concise way.
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › javascript fundamentals
Nullish coalescing operator '??'
In practice though, we may want ... is null/undefined. That is, when the value is really unknown/not set. ... The height || 100 checks height for being a falsy value, and it’s 0, falsy indeed. ... In practice, the zero height is often a valid value, that shouldn’t be replaced with the default. So ?? does just the right thing. The precedence of the ?? operator is the same ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › Nullish_coalescing_assignment
Nullish coalescing assignment (??=) - JavaScript | MDN
The nullish coalescing assignment (??=) operator, also known as the logical nullish assignment operator, only evaluates the right operand and assigns to the left if the left operand is nullish (null or undefined).
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-check-for-null-values-in-javascript
How to check for null values in JavaScript ? - GeeksforGeeks
July 23, 2025 - Example: In this example, we are using typeof Operator. ... // Function to check if a value is neither null nor undefined const isNotNullNorUndefined = (value) => typeof value !== "undefined" && (typeof value !== "object" || value !== null); ...
🌐
Matthewshields
matthewshields.co.uk › using optional chaining and nullish coalescing operator in javascript
Using Optional Chaining and Nullish Coalescing Operator in JavaScript | Matthew Shields | Leeds based Web Developer
August 15, 2021 - You might be thinking though - this looks similar to the Or operator || - why can't I just use that? The key difference is that the Nullish Coalescing Operator responds to a smaller set of conditions, specifically only when the value is null or undefined.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-check-for-null-in-javascript
JS Check for Null – Null Checking in JavaScript Explained
November 7, 2024 - But suppose you only want to check for null – then you can use the strict equality operator.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript-nullish-coalescing-operator
JavaScript Nullish Coalescing(??) Operator - GeeksforGeeks
JavaScript operators like logical OR (||), logical AND (&&), and null coalescing (??) are used for making conditional evaluations and performing logical operations in JavaScript.
Published   June 10, 2024
🌐
TypeScript
typescriptlang.org › docs › handbook › release-notes › typescript-2-0.html
TypeScript: Documentation - TypeScript 2.0
A new ! post-fix expression operator may be used to assert that its operand is non-null and non-undefined in contexts where the type checker is unable to conclude that fact. Specifically, the operation x! produces a value of the type of x with null and undefined excluded. Similar to type assertions of the forms <T>x and x as T, the ! non-null assertion operator is simply removed in the emitted JavaScript code.
🌐
Marius Schulz
mariusschulz.com › blog › nullish-coalescing-the-operator-in-typescript
Nullish Coalescing: The ?? Operator in TypeScript — Marius Schulz
August 14, 2021 - You might be wondering why the ... sacrificing correctness. For almost all values in JavaScript, the comparison value == null is equivalent to value === null || value === undefined....
🌐
daily.dev
daily.dev › home › blog › webdev › nullish coalescing operator (??) in javascript - what is it and how to use it?
Nullish Coalescing Operator (??) In JavaScript - What Is It And How To Use It?
November 1, 2021 - The Nullish Coalescing Operator allows us to check if a value is `null` or `undefined`, and provide a fallback value if that is the case.
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › objects: the basics
Optional chaining '?.'
April 14, 2022 - As we can see, all of them are straightforward and simple to use. The ?. checks the left part for null/undefined and allows the evaluation to proceed if it’s not so.
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › csharp › language-reference › operators › member-access-operators
Member access and null-conditional operators and expressions: - C# reference | Microsoft Learn
January 24, 2026 - You use several operators and expressions to access a type member. Member access operators include member access (.), array element, or indexer access ([]), index-from-end (^), range (..), null-conditional operators (?. and ?[]), and method invocation (()).
🌐
Wikipedia
en.wikipedia.org › wiki › Null_coalescing_operator
Null coalescing operator - Wikipedia
October 31, 2025 - As of ColdFusion 11, Railo 4.1, CFML supports the null coalescing operator as a variation of the ternary operator, ?:. It is functionally and syntactically equivalent to its C# counterpart, above. Example: ... Missing values in Apache FreeMarker will normally cause exceptions. However, both missing and null values can be handled, with an optional default value: ... JavaScript's nearest operator is ??, the "nullish coalescing operator", which was added to the standard in ECMAScript's 11th edition.
🌐
TutorialsPoint
tutorialspoint.com › home › javascript › javascript nullish coalescing operator
JavaScript Nullish Coalescing Operator
September 1, 2008 - The Nullish Coalescing operator in JavaScript is represented by two question marks (??). It takes two operands and returns the first operand if it is not null or undefined. Otherwise, it returns the second operand.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › Conditional_operator
Conditional (ternary) operator - JavaScript | MDN
const greeting = (person) => { const name = person ? person.name : "stranger"; return `Howdy, ${name}`; }; console.log(greeting({ name: "Alice" })); // "Howdy, Alice" console.log(greeting(null)); // "Howdy, stranger" The ternary operator is right-associative, which means it can be "chained" ...
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › csharp › language-reference › operators › null-coalescing-operator
?? and ??= operators - null-coalescing operators - C# reference | Microsoft Learn
January 24, 2026 - For more information about the ??= operator, see the Compound assignment section of the C# language specification. Null check can be simplified (IDE0029, IDE0030, and IDE0270)