No video

Optional Chaining Operator (?.) in JavaScript

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

dcode

dcode

Күн бұрын

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.mozi...
💜 Join my Discord Server:
/ discord
🎨 Download my Visual Studio Code theme:
marketplace.vi...
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
@srinivasaraoyp3640
@srinivasaraoyp3640 3 жыл бұрын
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.
@dasdisdus774
@dasdisdus774 6 ай бұрын
I've watched many videos about optional chaining operator but still don't understand until watch this. Thank you mate, god bless you.
@marcospereira-qv1lh
@marcospereira-qv1lh Жыл бұрын
I really liked your video. short, straight to the point, easy to understand. 100% tutorial quality. thanks for the service!
@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 🙂
@abdullahkhan-pr1ip
@abdullahkhan-pr1ip 10 ай бұрын
I opened multiple tabs to learn about optional changing operators, but after watching your video, I didn't need to look for others.
@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!
@dejanobradovic9723
@dejanobradovic9723 2 жыл бұрын
Best explanation that I found for Optional Chaining Operator! (subed)
@qinisodlamini1139
@qinisodlamini1139 2 жыл бұрын
Great video and explanation, I understood the concept in less that 2 minutes.
@EnzoAuditore
@EnzoAuditore 7 ай бұрын
Thank you for this mate.
@prudhvichinnam1488
@prudhvichinnam1488 3 жыл бұрын
Awesome content keep doing this for beginners it's lot a helpful Thankyou👍🙏
@thullyodamasceno8639
@thullyodamasceno8639 Жыл бұрын
What a great explanation! Really complete tutorial! Thanks!
@asheeshmathur
@asheeshmathur 3 жыл бұрын
Excellent Tutorial, I was looking for quick solution...God Bless You
@juliafeller3905
@juliafeller3905 Жыл бұрын
Explanation on point! Thanks a lot🙏
@captinblack113
@captinblack113 Жыл бұрын
Amazing explanation
@martinkarugaba
@martinkarugaba 2 жыл бұрын
Nice explanation, thanks
@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 3 жыл бұрын
@@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
@ohiwantyoutobelieve
@ohiwantyoutobelieve Жыл бұрын
Geat content, very clear
@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
@jamesbest2221
@jamesbest2221 2 жыл бұрын
This is excellent! (subscribed!)
@mohammed.haydar
@mohammed.haydar 3 жыл бұрын
Great tutorial very helpful 👌🏽❤️
@dcode-software
@dcode-software 3 жыл бұрын
Mate, glad it was helpful.
@rangabharath4253
@rangabharath4253 3 жыл бұрын
awesome as always
@beinyourguard
@beinyourguard 3 жыл бұрын
'And "supposedly" I'm 28 years old" I feel ya, man...
@htethtetoo9126
@htethtetoo9126 2 жыл бұрын
Best tutorial ever
@Minimaos1
@Minimaos1 10 ай бұрын
Thanks man!
@NACOSFOREVER
@NACOSFOREVER 2 жыл бұрын
Good and clear.
@dcode-software
@dcode-software 2 жыл бұрын
Glad it was helpful!
@soraubhsahu2782
@soraubhsahu2782 2 жыл бұрын
Thank you so much your explaining way is quite helpful
@esrasumer9894
@esrasumer9894 Жыл бұрын
your voice is amazing!
@maskman4821
@maskman4821 2 жыл бұрын
awesome explaining 😍
@ytpremi3402
@ytpremi3402 Жыл бұрын
This help me so much
@sistemazero
@sistemazero 2 жыл бұрын
Thanks for sharing!
@ErmiaAmirabadi
@ErmiaAmirabadi Жыл бұрын
thanks man!!!
@fethisert5527
@fethisert5527 5 ай бұрын
Thank you sir
@shakilahmed6870
@shakilahmed6870 2 жыл бұрын
You must have mentioned that what you have shown in 2:45 is called ternany operator
@minhphucle4117
@minhphucle4117 3 жыл бұрын
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 3 жыл бұрын
same here. can't use optional chaning in vscode
@quanganhnguyen7252
@quanganhnguyen7252 3 жыл бұрын
disable html formatter in extension can fix this
@minhphucle4117
@minhphucle4117 3 жыл бұрын
Thanks man, it's work for me, I am able to use optional chaining now :D
@sayedpritom
@sayedpritom 2 жыл бұрын
Thank you :)
@Lik4nGaming
@Lik4nGaming Жыл бұрын
Amazing videos, nothing more to say.
@KRAMDROIDTECH
@KRAMDROIDTECH 3 жыл бұрын
Thanks Bro, Very Solid 👌
@kmm_alpha
@kmm_alpha Жыл бұрын
Thank you
@alexpiano
@alexpiano 2 жыл бұрын
Thank you! worth the time :)
@jayanthsaikiran6624
@jayanthsaikiran6624 2 жыл бұрын
Cool vs theme. what font are you using in vs code ?
@ashmehr4946
@ashmehr4946 Жыл бұрын
nice!
@mahmodnasser3262
@mahmodnasser3262 Жыл бұрын
amazing
@zohnannor
@zohnannor 3 жыл бұрын
there is also optional indexing ?.[]
@farazmobin2776
@farazmobin2776 3 жыл бұрын
which font you are using
@saminyasar004
@saminyasar004 3 жыл бұрын
@dcode please tell me what font you are using?
@dcode-software
@dcode-software 3 жыл бұрын
Roboto Mono
@Rickyodus
@Rickyodus Жыл бұрын
Why do you keep calling Question mark(?) a dollar sign($)? 😩😄
@DeveloperRimon
@DeveloperRimon 2 жыл бұрын
thanks
@dcode-software
@dcode-software 2 жыл бұрын
You're welcome!
@ginot3790
@ginot3790 3 жыл бұрын
Wheres the blue switches mate? :)
@bullettime2808
@bullettime2808 3 жыл бұрын
There are a billion different names for this operator
@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 3 жыл бұрын
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
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
Magic trick 🪄😁
00:13
Andrey Grechka
Рет қаралды 57 МЛН
English or Spanish 🤣
00:16
GL Show
Рет қаралды 8 МЛН
He bought this so I can drive too🥹😭 #tiktok #elsarca
00:22
Elsa Arca
Рет қаралды 9 МЛН
Can This Bubble Save My Life? 😱
00:55
Topper Guild
Рет қаралды 87 МЛН
Array Slice vs. Splice in JavaScript: A HUGE DIFFERENCE
9:50
How to Implement a Queue in JavaScript
8:23
dcode
Рет қаралды 23 М.
Why I *Almost* NEVER Use LET in JavaScript
6:41
dcode
Рет қаралды 1,3 М.
Nullish Coalescing Operator - JavaScript Tutorial
4:46
dcode
Рет қаралды 15 М.
5 JavaScript Console Methods Every Developer Should Know
8:23
Why Is Array/Object Destructuring So Useful And How To Use It
13:24
Web Dev Simplified
Рет қаралды 424 М.
Two Easy Ways to Compare Dates in JavaScript
8:17
dcode
Рет қаралды 902
Magic trick 🪄😁
00:13
Andrey Grechka
Рет қаралды 57 МЛН