filmov
tv
Convert to optional chaining
Показать описание
#javascript #typescript #refactoring
Replace various guard expressions with the optional chaining operator (?.).
The optional chaining operator .? returns the value of an object property when the object is available and undefined otherwise. It is similar to the standard . chaining operator, with an added check if the object is defined (i.e., not nullish).
Replace various guard expressions with the optional chaining operator (?.).
The optional chaining operator .? returns the value of an object property when the object is available and undefined otherwise. It is similar to the standard . chaining operator, with an added check if the object is defined (i.e., not nullish).