Top "Optional-chaining" questions

Optional chaining is a process for querying and calling properties, methods, and subscripts on an optional that might currently be nil/null . If the optional contains a value, the property, method, or subscript call succeeds; if the optional is nil/null , the property, method, or subscript call returns nil/null.

How to use optional chaining with array or functions?

I'm trying to use optional chaining with an array instead of an object but not sure how to do that: …

javascript arrays typescript function optional-chaining
How to get optional chaining working in TypeScript?

Looks like optional chaining has landed. Here's an example What I can't figure out is how to get TS to …

typescript optional-chaining
Using optional chaining operator for object property access

TypeScript 3.7 now supports the optional chaining operator. Hence, you can write code such as: const value = a?.b?.c; I.…

javascript typescript optional-chaining
TypeScript 3.7.2 - Support for the experimental syntax 'optionalChaining' isn't currently enabled

In my project I am using TS 3.7.2 which should support optional chaining. But when I try to use it like …

typescript tsconfig optional-chaining
How to make webpack accept optional chaining without babel

Scenario: We're using webpack 4 to create a bundle from our Javascript sources. We're not using Babel because we're authoring only …

javascript webpack optional-chaining
How to chain attribute lookups that might return None in Python?

My problem is a general one, how to chain a series of attribute lookups when one of the intermediate ones …

python optional-chaining
How can I combine destructuring assignment and optional chaining?

I have a TypeScript interface with some optional fields and a variable of that type: interface Foo { config?: { longFieldName?: string; } } …

javascript typescript optional-chaining
Optional Chaining in JavaScript

I've been programming a lot in Swift recently. Today I did some work in JavaScipt when question popped up to …

javascript optional-chaining
Optional Chaining not enabled ReactNative

I am getting this error when running the android project in react react native. This is fresh install of react …

react-native babeljs optional-chaining