When i make any property of an interface optional, and while assigning its member to some other variable like this: You'll also see es2015 and typescript developers doing this instead, which creates an object from the 1st parameter (in my case an empty one) and copies the properties from. The key aspect to interfaces in typescript that distinguish them from types is that they can be extended with new functionality after they've already been declared.
List Typescript Curated by Ersakanti Belva Medium
In typescript, which is one to be preferred?
As of typescript 3.7 (released on november 5, 2019), this feature is supported and is called optional chaining:
Indeed, it is to flag values as not null and not undefined. At its core, optional chaining lets us write code. But what the bang operator generally does is, it turns off errors of typescript code when compiling it to.