Optional Chaining Operator (?.) in JavaScript
The optional chaining operator in JavaScript is convenient as it allows the developer to specify an object's property as being optional, and only return a value if the specified property is not "null" or "undefined" - otherwise return "undefined".
It's helpful when accessing data from an API, or generally where you're not too sure what data will look like, or knowing where optional fields exist. It can also be used in combination with the nullish coalescing operator to provide smart defaults 🙂
Join this channel to get access to perks:
/ @dcode-software
For your reference, check this out:
developer.mozilla.org/en-US/d...
💜 Join my Discord Server:
/ discord
🎨 Download my Visual Studio Code theme:
marketplace.visualstudio.com/...
Support me on Patreon:
/ dcode
Follow me on Twitter:
@dcodeyt
If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
#dcode #javascript
Пікірлер: 70
Uptill now, I have seen many video demo's on optional chaining operator. Your demo is excellent, in addition to it, you have covered so many topics, one after the other. Thank you very much.
I've watched many videos about optional chaining operator but still don't understand until watch this. Thank you mate, god bless you.
I opened multiple tabs to learn about optional changing operators, but after watching your video, I didn't need to look for others.
I really liked your video. short, straight to the point, easy to understand. 100% tutorial quality. thanks for the service!
thanks for comparing the optional operator with the ternary operator of java at 2:46 . It made me understand profoundly.
@dcode-software
2 жыл бұрын
Glad it could help you 🙂
Great content and examples! Thanks for saving us time!
Bloody hell man, you're so good at explaining those concepts! Thank you so much :)
Thank you for this mate.
Awesome content keep doing this for beginners it's lot a helpful Thankyou👍🙏
Explanation on point! Thanks a lot🙏
What a great explanation! Really complete tutorial! Thanks!
Excellent Tutorial, I was looking for quick solution...God Bless You
Great video and explanation, I understood the concept in less that 2 minutes.
Best explanation that I found for Optional Chaining Operator! (subed)
This is excellent! (subscribed!)
awesome as always
Thank you so much your explaining way is quite helpful
Nice explanation, thanks
Amazing explanation
Geat content, very clear
Thanks for sharing!
This help me so much
Thanks man!
Thanks Bro, Very Solid 👌
Best tutorial ever
awesome explaining 😍
Thank you! worth the time :)
Good and clear.
@dcode-software
2 жыл бұрын
Glad it was helpful!
thanks man!!!
Thank you sir
Thank you :)
Thank you
i have been using ? at work without really knowing what it does (the linter just tells me to add it). this video was very helpful. thanks
Amazing videos, nothing more to say.
Cool vs theme. what font are you using in vs code ?
which font you are using
your voice is amazing!
'And "supposedly" I'm 28 years old" I feel ya, man...
amazing
nice!
there is also optional indexing ?.[]
Great tutorial very helpful 👌🏽❤️
@dcode-software
3 жыл бұрын
Mate, glad it was helpful.
No one seemed to pick up that you kept calling the question marks "dollar signs" haha.
@dcode-software
3 жыл бұрын
For real? Hahaha
@smoothbeak
3 жыл бұрын
@@dcode-software Haha I believe so, unless I'm hearing things, which is possible!
@smoothbeak
3 жыл бұрын
@@dcode-software 7:40
@Ctrl_Alt_Elite
2 жыл бұрын
@@smoothbeak lol completely went over my head somehow 🤯😂
@vinade2100
2 жыл бұрын
I had to find your comment just to confirm I am not going insane xD
@dcode please tell me what font you are using?
@dcode-software
3 жыл бұрын
Roboto Mono
thanks
@dcode-software
2 жыл бұрын
You're welcome!
My vscode keep adding space before and after my question mark so i can't use the optional chaining.Do you know how to fix that?Pls help me =
@quanganhnguyen7252
3 жыл бұрын
same here. can't use optional chaning in vscode
@quanganhnguyen7252
3 жыл бұрын
disable html formatter in extension can fix this
@minhphucle4117
3 жыл бұрын
Thanks man, it's work for me, I am able to use optional chaining now :D
You must have mentioned that what you have shown in 2:45 is called ternany operator
Wheres the blue switches mate? :)
There are a billion different names for this operator
Why do you keep calling Question mark(?) a dollar sign($)? 😩😄
Super bro..from india...my suggestion.. please speak in slow for clear understanding of your English.. Do complete javascript tutorial
@bullettime2808
3 жыл бұрын
My suggestion: learn English
@softwarejobkosam7327
3 жыл бұрын
@@bullettime2808 as a youtube r ...take suggestion s positively.....it's good for your channel improvement.. 👍
@smoothbeak
3 жыл бұрын
I feel as though he already speaks quite slowly (and clearly too)
@billsmoke3929
3 жыл бұрын
Not to be rude but he is speaking clearly and slowly
@damianodamian7907
Жыл бұрын
His way of explaining is crystal clear I would say. I personally find difficult to understand English spoken by Indians. Probably is the same the way around. Use subtitles, it will help you