Skip to main content
Tooling
0 votes
2 replies
59 views

I am using optional chaining quite often, but so far never encounter that issue, until today: if both items can be undefined, rather don't use optional chaining. Only last test (below) can help in ...
allez l'OM's user avatar
0 votes
0 answers
77 views

When designing TypeScript props for React components, I'm sometimes unsure whether I should type props like: prop?: Type or prop: Type | undefined My understanding so far: prop?: Type The prop ...
Andrey Rafalskyi's user avatar
1 vote
1 answer
162 views

I have this problem - I cannot use Tailwind in my project or optional chaining operator (?.) because VSCode adds an extra whitespace after a colon or after a dot. In case of taiwind, it adds a ...
jj j's user avatar
  • 59
0 votes
1 answer
78 views

I am using TypeScript 5.7.3. Installed @types/[email protected]. TypeScript config: { "compilerOptions": { "target": "ES2020", "moduleResolution": &...
Daniel Gruszczyk's user avatar
4 votes
2 answers
258 views

We have an application that needs to be supported in old Chrome (v79). Angular Version 13.2.7 Typescript Version 4.5.5 Node Version 16.14.0 We are getting an error: ERROR: Big integer literals are not ...
Ajit Hingmire's user avatar
1 vote
2 answers
96 views

I'm using an Optional.of chain in Java to get a value, Integer yearOfBirth = Optional.ofNullable(employee) .map(Employee::getDateOfBirth) ....
mccarthyj's user avatar
  • 949
-6 votes
1 answer
164 views

The use case is a user/client sends a request to a server running PHP. I am trying to write the PHP code on the server e.g. an API endpoint to process the request. I have existing production PHP code ...
user6631314's user avatar
  • 2,050
8 votes
6 answers
2k views

In Javascript, if I have a potentially null object obj, which, if not null, will have a field x - I can write obj?.x. This is called "optional chaining" or "safe navigation": If ...
einpoklum's user avatar
  • 137k
0 votes
1 answer
390 views

I have scenario in my project that a common shared service having a common variable (object) to store nested objects. I have to access and update its value in html using NgModel. Optional-chaining ...
Anupam Sharma's user avatar
0 votes
1 answer
121 views

I came across the below code: public void method(MyObject obj) { String value = Optional.ofNullable(obj) .map(x -> obj.doSomething()) ....
Gautham M's user avatar
  • 4,996
0 votes
1 answer
173 views

I've encountered an unexpected behavior while using the Optional API in Java. Session session = sessionService .getSessionById(id) .orElse( ...
Souhaib's user avatar
  • 119
0 votes
1 answer
172 views

In VSCode, IntelliSense is saying a property does not exist on an object in a TypeScript file even when I specify the optional chaining syntax to short-circuit the error. The code compiles correctly ...
Rob W's user avatar
  • 23
1 vote
1 answer
88 views

I struggle with finding an elegant way to convert a variable of type Optional<String[]> to Optional<String> and joining all elements of the given array. Is there an elegant solution for ...
Oliver's user avatar
  • 4,273
0 votes
0 answers
138 views

I am working on Python code where the domain logic makes it natural to have a class with an optional field of a second class, which itself has an optional field of a third class. Boiling it down to a ...
Erlend Magnus Viggen's user avatar
2 votes
2 answers
256 views

in a node repl or browser console: > ({})?.a undefined > (null)?.a undefined > (null)?.a.b undefined > ({})?.a.b Uncaught TypeError: Cannot read properties of undefined (reading 'b') if (...
dtudury's user avatar
  • 639

15 30 50 per page
1
2 3 4 5
13