#Ezeikel - Typescript

1 messages ยท Page 1 of 1 (latest)

swift yacht
#

Hi ๐Ÿ‘‹
๐Ÿค”

radiant crater
#

Hey ๐Ÿ‘‹

swift yacht
#

Does the Customer object have a value for the email property?

radiant crater
#

Yeah it all works fine its just that when running tsc i get this error and also VS Code flags it as an issue

#

I can also see it exists in node_modules

swift yacht
#

It may be a value that could be null. For the little bit of Typescript I've worked on I've had to add many a .? to indicate that

#

Okay and the email property is itself nullable

radiant crater
#

Yeah i can see it is an optional property whereas id is not

swift yacht
#

What happens if you do put a ? at the end of email?

radiant crater
#

Incorrect syntax

#

I think it would be more like this:

#

But still same error

swift yacht
#

Hmmm...