Optional Chaining Operator (?.) in JavaScript

  Рет қаралды 23,311

dcode

dcode

3 жыл бұрын

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
@muhammadhafizh9757
@muhammadhafizh9757 3 ай бұрын
I've watched many videos about optional chaining operator but still don't understand until watch this. Thank you mate, god bless you.
@srinivasaraoyp3640
@srinivasaraoyp3640 2 жыл бұрын
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.
@marcospereira-qv1lh
@marcospereira-qv1lh Жыл бұрын
I really liked your video. short, straight to the point, easy to understand. 100% tutorial quality. thanks for the service!
@abdullahkhan-pr1ip
@abdullahkhan-pr1ip 8 ай бұрын
I opened multiple tabs to learn about optional changing operators, but after watching your video, I didn't need to look for others.
@fahmidhossainSakib
@fahmidhossainSakib 2 жыл бұрын
thanks for comparing the optional operator with the ternary operator of java at 2:46 . It made me understand profoundly.
@dcode-software
@dcode-software 2 жыл бұрын
Glad it could help you 🙂
@damianodamian7907
@damianodamian7907 Жыл бұрын
Bloody hell man, you're so good at explaining those concepts! Thank you so much :)
@MinhNgwen
@MinhNgwen 2 жыл бұрын
Great content and examples! Thanks for saving us time!
@thullyodamasceno8639
@thullyodamasceno8639 Жыл бұрын
What a great explanation! Really complete tutorial! Thanks!
@asheeshmathur
@asheeshmathur 2 жыл бұрын
Excellent Tutorial, I was looking for quick solution...God Bless You
@prudhvichinnam1488
@prudhvichinnam1488 3 жыл бұрын
Awesome content keep doing this for beginners it's lot a helpful Thankyou👍🙏
@qinisodlamini1139
@qinisodlamini1139 Жыл бұрын
Great video and explanation, I understood the concept in less that 2 minutes.
@juliafeller3905
@juliafeller3905 Жыл бұрын
Explanation on point! Thanks a lot🙏
@dejanobradovic9723
@dejanobradovic9723 Жыл бұрын
Best explanation that I found for Optional Chaining Operator! (subed)
@EnzoAuditore
@EnzoAuditore 4 ай бұрын
Thank you for this mate.
@soraubhsahu2782
@soraubhsahu2782 2 жыл бұрын
Thank you so much your explaining way is quite helpful
@jamesbest2221
@jamesbest2221 2 жыл бұрын
This is excellent! (subscribed!)
@rangabharath4253
@rangabharath4253 3 жыл бұрын
awesome as always
@sistemazero
@sistemazero 2 жыл бұрын
Thanks for sharing!
@martinkarugaba
@martinkarugaba Жыл бұрын
Nice explanation, thanks
@KRAMDROIDTECH
@KRAMDROIDTECH 3 жыл бұрын
Thanks Bro, Very Solid 👌
@alexpiano
@alexpiano 2 жыл бұрын
Thank you! worth the time :)
@captinblack113
@captinblack113 Жыл бұрын
Amazing explanation
@Minimaos1
@Minimaos1 8 ай бұрын
Thanks man!
@ohiwantyoutobelieve
@ohiwantyoutobelieve Жыл бұрын
Geat content, very clear
@ytpremi3402
@ytpremi3402 Жыл бұрын
This help me so much
@htethtetoo9126
@htethtetoo9126 2 жыл бұрын
Best tutorial ever
@maskman4821
@maskman4821 Жыл бұрын
awesome explaining 😍
@novanoskillz4151
@novanoskillz4151 Жыл бұрын
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
@fethisert5527
@fethisert5527 2 ай бұрын
Thank you sir
@ErmiaAmirabadi
@ErmiaAmirabadi Жыл бұрын
thanks man!!!
@kmm_alpha
@kmm_alpha Жыл бұрын
Thank you
@sayedpritom
@sayedpritom 2 жыл бұрын
Thank you :)
@NACOSFOREVER
@NACOSFOREVER 2 жыл бұрын
Good and clear.
@dcode-software
@dcode-software 2 жыл бұрын
Glad it was helpful!
@jayanthsaikiran6624
@jayanthsaikiran6624 2 жыл бұрын
Cool vs theme. what font are you using in vs code ?
@beinyourguard
@beinyourguard 3 жыл бұрын
'And "supposedly" I'm 28 years old" I feel ya, man...
@Lik4nGaming
@Lik4nGaming Жыл бұрын
Amazing videos, nothing more to say.
@mahmodnasser3262
@mahmodnasser3262 Жыл бұрын
amazing
@ashmehr4946
@ashmehr4946 Жыл бұрын
nice!
@mohammed.haydar
@mohammed.haydar 3 жыл бұрын
Great tutorial very helpful 👌🏽❤️
@dcode-software
@dcode-software 3 жыл бұрын
Mate, glad it was helpful.
@farazmobin2776
@farazmobin2776 3 жыл бұрын
which font you are using
@smoothbeak
@smoothbeak 3 жыл бұрын
No one seemed to pick up that you kept calling the question marks "dollar signs" haha.
@dcode-software
@dcode-software 3 жыл бұрын
For real? Hahaha
@smoothbeak
@smoothbeak 3 жыл бұрын
@@dcode-software Haha I believe so, unless I'm hearing things, which is possible!
@smoothbeak
@smoothbeak 3 жыл бұрын
@@dcode-software 7:40
@Ctrl_Alt_Elite
@Ctrl_Alt_Elite 2 жыл бұрын
@@smoothbeak lol completely went over my head somehow 🤯😂
@vinade2100
@vinade2100 2 жыл бұрын
I had to find your comment just to confirm I am not going insane xD
@esrasumer9894
@esrasumer9894 Жыл бұрын
your voice is amazing!
@shakilahmed6870
@shakilahmed6870 2 жыл бұрын
You must have mentioned that what you have shown in 2:45 is called ternany operator
@DeveloperRimon
@DeveloperRimon Жыл бұрын
thanks
@dcode-software
@dcode-software Жыл бұрын
You're welcome!
@zohnannor
@zohnannor 3 жыл бұрын
there is also optional indexing ?.[]
@saminyasar004
@saminyasar004 2 жыл бұрын
@dcode please tell me what font you are using?
@dcode-software
@dcode-software 2 жыл бұрын
Roboto Mono
@minhphucle4117
@minhphucle4117 2 жыл бұрын
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
@quanganhnguyen7252 2 жыл бұрын
same here. can't use optional chaning in vscode
@quanganhnguyen7252
@quanganhnguyen7252 2 жыл бұрын
disable html formatter in extension can fix this
@minhphucle4117
@minhphucle4117 2 жыл бұрын
Thanks man, it's work for me, I am able to use optional chaining now :D
@ginot3790
@ginot3790 3 жыл бұрын
Wheres the blue switches mate? :)
@bullettime2808
@bullettime2808 3 жыл бұрын
There are a billion different names for this operator
@Rickyodus
@Rickyodus Жыл бұрын
Why do you keep calling Question mark(?) a dollar sign($)? 😩😄
@softwarejobkosam7327
@softwarejobkosam7327 3 жыл бұрын
Super bro..from india...my suggestion.. please speak in slow for clear understanding of your English.. Do complete javascript tutorial
@bullettime2808
@bullettime2808 3 жыл бұрын
My suggestion: learn English
@softwarejobkosam7327
@softwarejobkosam7327 3 жыл бұрын
@@bullettime2808 as a youtube r ...take suggestion s positively.....it's good for your channel improvement.. 👍
@smoothbeak
@smoothbeak 3 жыл бұрын
I feel as though he already speaks quite slowly (and clearly too)
@billsmoke3929
@billsmoke3929 2 жыл бұрын
Not to be rude but he is speaking clearly and slowly
@damianodamian7907
@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
Optional Chaining Operator in JavaScript, Simplified
8:55
Deeecode The Web
Рет қаралды 585
Smart Sigma Kid #funny #sigma #comedy
00:19
CRAZY GREAPA
Рет қаралды 13 МЛН
UFC Vegas 93 : Алмабаев VS Джонсон
02:01
Setanta Sports UFC
Рет қаралды 201 М.
Maps vs. Objects in JavaScript - What's the Difference?
11:48
JS Spread Operator: How It Works & Why I Love It
16:31
Colt Steele
Рет қаралды 75 М.
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
Another 5 Must Know JavaScript Features That Almost Nobody Knows
22:42
Web Dev Simplified
Рет қаралды 212 М.
Higher Order Functions - JavaScript Tutorial
10:10
ColorCode
Рет қаралды 60 М.
Is THIS Python's MOST Underrated Operator? (Walrus Operator)
5:45
Spread and REST operators in Javascript
14:00
Hitesh Choudhary
Рет қаралды 51 М.