You changed the title from _" JS ? in 100 seconds"_ to _" ? in NaN seconds"_ Cool
@amine_akad3 жыл бұрын
Maybe KZbin's script didn't recognise "100" and displayed NaN instead
@thos34743 жыл бұрын
@@amine_akad It's due to the fact the video is longer than 100 seconds
@Fireship3 жыл бұрын
I think "? in NaN seconds" has a better ring to it
@amine_akad3 жыл бұрын
@@thos3474 ikr, my reply was sarcastic
@oskrm3 жыл бұрын
@@Fireship has a better [object] to it
@GoodVolition3 жыл бұрын
I used to be very down on the ternary operator. I've come to see they have a place. Great mention of optional chaining I'm a big fan.
@TheNewton3 жыл бұрын
You can get that feeling back when you have to debug a nested set of ternary's more than a few deep. Otherwise perfect for oneliner toggles not involving booleans
@pitust3 жыл бұрын
The ternary is still worse than rust-y if case expressions.
@hsemog3 жыл бұрын
Hey Jeff, We need a “Fireship answers in 100 seconds” 😄
@KangJangkrik3 жыл бұрын
Can't wait until someone ask face reveal
@IanSfirebirdflame3 жыл бұрын
Just so you know, your videos have changed my coding style over time. I keep learning new abilities, or nice features I didn't know about, resulting in me going back to my code and making changes with these cleaner solutions. Your videos are having a direct impact on me. Thank you.
@Fireship3 жыл бұрын
Glad I could help!
@girllovescoding3 жыл бұрын
It feels like I was waiting my whole life for JS to introduce optional chaining. Thanks for a great video!
@realgarmingo3 жыл бұрын
This channel is amazingly helpful. Thanks.
@duuhhveeed3 жыл бұрын
Holy mackeral, ive been obj chaining recently and wanted to find a better solution and you just showed me something big. Fireship does it again
@cicicad3 жыл бұрын
Same here, down with (foo || {}).bar
@mycloudvip3 жыл бұрын
We’re are here to stay. We love your 100 Sec. Videos. Thumbs up
@Chiefsosa173 жыл бұрын
Ternary on return values are actually very readable once you get used to it. Just make sure you split the condition and the returns on each separated line
@Fireship3 жыл бұрын
I agree, it's just a common criticism when people first encounter them.
@softwarelivre23893 жыл бұрын
@@Fireship sometimes I even chain ternaries, like: cond > 100 ? '#FFFFFF' : cond > 80 ? '#999999': cond > 30 ? '#444444': '#181818';
@Chiefsosa173 жыл бұрын
@@softwarelivre2389 I dont this this is too bad either, but couldn't this be turned in a Switch statement then?
@tomebundalevski18723 жыл бұрын
@@Chiefsosa17 no
@softwarelivre23893 жыл бұрын
@@Chiefsosa17 this is more declarative than switch statements, doesn't create new scopes and is more straightforward, but I mainly use this on simple one-off scripts.
@ExtremeGamer1097153 жыл бұрын
Subscribing to this channel was the best choice ever!
@suman-majhi3 жыл бұрын
I would like to add one more operater in this list which is Logical Nullish assignment operator ("??=") Example: let a=7; let b=null; console.log(b) //null console.log(b??=a) // 7 console.log(b) // 7
@quirky_hehe3 жыл бұрын
I'm a an experience developer and I actually learned something. Great videos as always!
@kylemckell3 жыл бұрын
Jeff, I think you juet saved my life by letting me know how to solve a pesky bug from fetching data from an unreliable api with the optional chaining.
@softwarelivre23893 жыл бұрын
Unreliable APIs are hell on earth without optional chaining. Been through that path, my friend, and it is indeed not beautiful.
@klutch41983 жыл бұрын
the most powerful 100 seconds video yet
@mirandamoralez63543 жыл бұрын
depth, sound, voice - so great always! THX A LOT!
@reyanrahman3 жыл бұрын
U have no idea how much time this little question mark will save thank you so much keep making more shorts like this
@othman_3 жыл бұрын
Im very glad in the past i've learned Swift , Ruby and Java. Javascript NOW take many great ideas from these languages and evolve with developers.
@iancuvlad73683 жыл бұрын
1:42 That Kotlin feeling...
@adambickford87203 жыл бұрын
Glad you brought up the expressions vs declaration. mutation is evil, even more so in a multi-threaded language. It's the same reason you should generally avoid ALL declaration like if, for, while, switch, etc. and prefer reduce, map, etc
@Roboprogs9 ай бұрын
Erlang has entered the chat… 😁
@CodingWithLewis3 жыл бұрын
Love your videos. Very proud to say that I am here before you hit 1 million subs.
@ark54583 жыл бұрын
should be: js in NaN seconds
@Fireship3 жыл бұрын
I concur!
@ayoubbelmehdi61963 жыл бұрын
Or undefined in NaN seconds
@ark54583 жыл бұрын
Haha, you actually did it
@vallemuller55943 жыл бұрын
[object Object]
@Musaakdaag123 жыл бұрын
Thanks i knew about Michael Hill! He was my professor in Oxford and told us about FBC14 algorithm!
@Nintron3 жыл бұрын
Watched this video and then 30 minutes later I needed some default value if one wasn't passed and remembered nullish coalescing from this video. Big thanks!
@aleksandarstevanovic58543 жыл бұрын
I had NO freaking idea for optional chaining, and was doing && && &&, and i was very glad they implemented in php 8.0, didn't know i had this on both sides... Thanks dude!
@lukehatcher983 жыл бұрын
Wow nullish coalescing sounds amazing. I’m gonna start using that right away 🤩
@octagonalt73113 жыл бұрын
i love videos like these, keep it up!
@akashmelkeri Жыл бұрын
it's been nearly 8 months since i started using js for work. and today i got to know 2nd and 3rd use of question mark. these 2 uses will save a lot of time for me buddy. thanks
@valentincamus83433 жыл бұрын
Thank you very much for the optional chaining !
@TudoSempre3 жыл бұрын
I definitely don't get tired of watching your videos.
@JandyCZ3 жыл бұрын
This solves 2 problems very efficiently.
@mirkosedda31963 жыл бұрын
These videos are more valuable than they are short.. just brilliant job!
@neeeeeck90053 жыл бұрын
Glad you changed the title in time! I'd not watch a video otherwise and probably regret it. Your content is on top, as always. Like.
@TehLostGamers3 жыл бұрын
I know those operations and still watch the video, it's very amusing and to the point. I love your videos keep up the great work!!!
@nathanielyoung3 жыл бұрын
Freaking love the ternary operator!!
@diete1033 жыл бұрын
I thank you so much for this video because optional changing is something I didn't know I needed in my life!!!!
@pierluigiomargiancola73883 жыл бұрын
Thanks, didn't know about Nullish Coalescing :)
@nyghtseven3 жыл бұрын
I changed mission to python for more than a year now, but everytime you release a video i want to go back to js !
@complex53723 жыл бұрын
Wow, didn't know about that last case. Thanks for sharing.
@nothingnoone87523 жыл бұрын
Woooow this was useful, nullish coalescing is gonna save me so many try()'s
@sanzhar.danybayev3 жыл бұрын
Thank you! I use all of them when I code
@rafaelpernil3 жыл бұрын
I use those daily and they really make JS much more enjoyable and concise
@edencheung84683 жыл бұрын
That was the most I have learnt about programming in 100 seconds!
@RonDLite3 жыл бұрын
Best title in ages, great start of the weekend
@TheRealKitWalker3 жыл бұрын
Ohh yes, I felt soo good after I used in my project earlier this month. It felt liberating 😍😍
@akifimran97802 жыл бұрын
so much information....makes me happy.
@TheSuperSausageDog3 жыл бұрын
I only sometimes use javascript so I never heard about optional chaining. This is huge!
@CorruptedPixl3 жыл бұрын
Damn, at the start I was like "I know what a ternary operator is, hah" but ended up learning 2 new ways to use it, awesome!
@epajarjestys99813 жыл бұрын
the other two ways are not ternary operator
@AutisticThinker3 жыл бұрын
Mind blown in 100 seconds.
@ThePayanazo3 жыл бұрын
Thanks for this man, i appreciate your teaching, for a person who is starting in this, this is literally gold.
@watchocho26603 жыл бұрын
I'm going to use this to restructure my whole codebase. Awesome.👍
@chiefkanakana3 жыл бұрын
Gosh, nullish one was literally life changing ✌🏽 Thank you!!
@0xcoburn3 жыл бұрын
Awesome video Jeff!
@marcopetaccia883 жыл бұрын
Thanks, great explanation!
@allisonmachado2 жыл бұрын
Again, another awesome video 😎
@chinmaypadole90803 жыл бұрын
Being a C# Developer, it feels great to see these changes in JS
@mo993 жыл бұрын
2021 Jeff is on a roll with these videos 🔥
@ChessFlix3 жыл бұрын
You really make some crazy good tuts man.
@daleryanaldover65453 жыл бұрын
when I learned ternary operator, it was life changing.
@thebaconbreadful3 жыл бұрын
I really like these videos. Your production value is SO high. Thats especially notable because other programming tutorials are so long and unorga-/optimized. I think it would be a really good time to update your firebase/angular authentication video. It would not only come in a good time personally but also fit nicely with the firebase basics and security uploads :)
@kenji13663 жыл бұрын
Thank you. Short vid and gives much knowledge. Saw lots of these ternary expression used in codewars
@vcoppolecchia3 жыл бұрын
@fireship I LOVE YOUR CHANNEL!
@CrackThrough3 жыл бұрын
i needed this. thank you.
@lawlessfpv3 жыл бұрын
I LOVE the ? expression ❤️
@user-he4ef9br7z3 жыл бұрын
Those days I used the ternary operator in school just to confuse the hell out teachers.
@aidenyang7473 жыл бұрын
I can’t wait for your NextJS firebase course!
@abdo.magdy.3 жыл бұрын
The optional chaining is called Nullsafe operator in langs like csharp and php and many other langs
@Roboprogs9 ай бұрын
“Elvis” operator in Ruby
@Muaddibkhan3 жыл бұрын
Great video as always
@snithfferx7 ай бұрын
Thanks for the video. It answer some of my questions of ?? and ?, and why is not using in JS... was because I didn't is exists. Now, is time to update lines... see ya.!
@nerf667703 жыл бұрын
Great video, as always! Thank you for wrapping this info nicely
@andrejvujic3 жыл бұрын
More flutter please!! Btw great video
@_tsu_3 жыл бұрын
Rust has no ternary but it's if statements can return values so you can do "let foo=if(a>b)bar else 0;”
@RoosterLewis3 жыл бұрын
This is exactly what I needed. Thanks!
@JeffPohlmeyer3 жыл бұрын
YOU'VE BLOWN MY MIND!!!!
@TheRanguna3 жыл бұрын
Minor nitpick, the token for optional chaining is '?.', question mark and a dot, they both replace the normal dot. Either way, great overview
@briandesign3 жыл бұрын
can't believe I'm this early
@letsbuildseries3 жыл бұрын
This is fantastic! Great job!
@KarteekRakshit3 жыл бұрын
Thank you... The second one is definitely life changing.
@kuldipthakkar15083 жыл бұрын
Amazing Sir 💫💫
@EXQEX93 жыл бұрын
Optional chaining has had full support since Chrome 80 and I had literally no idea until this video. I'm only thirty years old...I thought it would take way longer to become this slow.
@fidelsule41813 жыл бұрын
Nice video glad to be first to watch
@heibam3 жыл бұрын
GOD DAMN it is insanely helpful
@itzmeB23 жыл бұрын
Love the outro
@MythiPlayz3 жыл бұрын
I would love a video comparing and contrasting dart and js.
@albertbennett62903 жыл бұрын
I think he already did one kzbin.info/www/bejne/baSti5xmnNd5iJY
@pantanom183 жыл бұрын
amazin explanation good job
@mattoattacko3 жыл бұрын
This was actually really helpful, thank you!
@a29stech333 жыл бұрын
You are great, you are fast that's why easy to understand, && save time.
@mohanaggarwal40583 жыл бұрын
Well, good to know that js have these operators, do u know, kotlin already have these operators, first one is the safe call operator, which is just like operator in js but it is compulsory to use on all nullable objects, and second one is elvis operator(?:), which is exactly like - ?? in js, that will give default or second value if first value is null, otherwise the first value. Well, im hoping that u'll made one video on kotlin, it is really awesome, and it is the language that i have learnt so far, and yes i have tried many languages, but kotlin literally felt the best and did a great job. But best of luck and keep making videos like these.☺👍
@paulwhiterabbit3 жыл бұрын
Its great that JavaScript gets new features. But if possible, I want to use Typescript or at least a framework so I can utilize the new features without worrying about browser support and polyfills.
@jonlothar61263 жыл бұрын
Great Video (as always)! I've never been able to figure out - whats the VS Code theme and material icon theme that you use?
@lolownq3 жыл бұрын
Theme and icons are in video description
@Sxxov3 жыл бұрын
don't forget about `??=`! super nice to have next to the other conditional assignment operators eg. `x ??= y`becomes equivalent to `x ?? (x = y)`
@evandroprogram3 жыл бұрын
You forgot the nullish assignment operator (??=) which is also very handy!
@jovan93bl3 жыл бұрын
Another great video, thx
@ninjaasmoke3 жыл бұрын
You don't have to tell me to hit the like button, I always learn something new I always hit like♥️🤩
@krozaine3 жыл бұрын
From Ruby on Rails (RoR) : 1. user.try(:write).try(:code) 2. amount = amount.presence || 23.99
@denzel420 Жыл бұрын
its just gold!
@arielmorningstar33993 жыл бұрын
Awesome vid!
@ahverypro3 жыл бұрын
I love you ternary operator
@shateq3 жыл бұрын
Really cool video
@Chmze7992 жыл бұрын
i'm pretty sure the analog for this in lua is "condition and truthyValue or falsyValue" since it basically works the same