This is likely going to be a rather noob question however I hadn’t seen it done before so I figured I’d ask. The ? after the element name, does that just cause it to disregard the index value? (Likely butchering my Js terminology here but hopefully the question makes sense)
Hello. The ? operator will check only for the existence of value(it's called optional chaining).
Ex: userData?.email will return value of email variable if it exists otherwise undefined.
Here is a good documentation on this subject: developer.mozilla.org/en-US/docs/W...
Hope u find this useful.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is likely going to be a rather noob question however I hadn’t seen it done before so I figured I’d ask. The ? after the element name, does that just cause it to disregard the index value? (Likely butchering my Js terminology here but hopefully the question makes sense)
Hello. The ? operator will check only for the existence of value(it's called optional chaining).
Ex: userData?.email will return value of email variable if it exists otherwise undefined.
Here is a good documentation on this subject:
developer.mozilla.org/en-US/docs/W...
Hope u find this useful.