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
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.
Phonology in ≈100 Characters (1:48) The second ⟨c⟩ of _coalescing_ is silent as is so w/ many instances of ⟨sc⟩; consider, e.g., _science_ , _ascend_ , & _abscess_ .
His pronunciation of that made my question everything I thought I knew about my native language until I read this comment. Says a lot about how much faith I have in Fireship that my immediate thought was "oh god, I've been saying that wrong my whole life"
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!
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
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!
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
@@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.
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
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 :)
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
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.!
The optional chaining and nullish coalescing features are available since ECMA script 2020. Available since: - Chrome 80 - iOS Safari 13.4 - Node.js 14.0.0 - TypeScript 3.7
Thank you so much for making a video on optional chaining and bullish coalescing; these methods can be challenging to find info about as they're still quite new and "? javascript" doesn't return much of anything useful when doing a search.
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.☺👍
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.
You changed the title from
_" JS ? in 100 seconds"_ to
_" ? in NaN seconds"_
Cool
Maybe RUclips's script didn't recognise "100" and displayed NaN instead
@@amine_akad It's due to the fact the video is longer than 100 seconds
I think "? in NaN seconds" has a better ring to it
@@thos3474 ikr, my reply was sarcastic
@@Fireship has a better [object] to it
It feels like I was waiting my whole life for JS to introduce optional chaining. Thanks for a great video!
Hey Jeff,
We need a “Fireship answers in 100 seconds” 😄
Can't wait until someone ask face reveal
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.
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
The ternary is still worse than rust-y if case expressions.
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
Same here, down with (foo || {}).bar
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.
Glad I could help!
Phonology in ≈100 Characters
(1:48) The second ⟨c⟩ of _coalescing_ is silent as is so w/ many instances of ⟨sc⟩; consider, e.g., _science_ , _ascend_ , & _abscess_ .
His pronunciation of that made my question everything I thought I knew about my native language until I read this comment. Says a lot about how much faith I have in Fireship that my immediate thought was "oh god, I've been saying that wrong my whole life"
@@MatthewTaylor86 Same here, I found you guys' comments while trying to make sure.
Love your videos. Very proud to say that I am here before you hit 1 million subs.
I'm a an experience developer and I actually learned something. Great videos as always!
depth, sound, voice - so great always! THX A LOT!
This channel is amazingly helpful. Thanks.
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!
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
We’re are here to stay. We love your 100 Sec. Videos. Thumbs up
U have no idea how much time this little question mark will save thank you so much keep making more shorts like this
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!
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.
I definitely don't get tired of watching your videos.
I use those daily and they really make JS much more enjoyable and concise
Subscribing to this channel was the best choice ever!
Wow nullish coalescing sounds amazing. I’m gonna start using that right away 🤩
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.
These videos are more valuable than they are short.. just brilliant job!
should be: js in NaN seconds
I concur!
Or undefined in NaN seconds
Haha, you actually did it
[object Object]
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!!!
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
I agree, it's just a common criticism when people first encounter them.
@@Fireship sometimes I even chain ternaries, like:
cond > 100 ? '#FFFFFF' :
cond > 80 ? '#999999':
cond > 30 ? '#444444':
'#181818';
@@softwarelivre2389 I dont this this is too bad either, but couldn't this be turned in a Switch statement then?
@@Chiefsosa17 no
@@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.
Thanks i knew about Michael Hill! He was my professor in Oxford and told us about FBC14 algorithm!
i love videos like these, keep it up!
the most powerful 100 seconds video yet
I thank you so much for this video because optional changing is something I didn't know I needed in my life!!!!
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
Thanks for this man, i appreciate your teaching, for a person who is starting in this, this is literally gold.
Thank you very much for the optional chaining !
1:42 That Kotlin feeling...
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.
Unreliable APIs are hell on earth without optional chaining. Been through that path, my friend, and it is indeed not beautiful.
Best title in ages, great start of the weekend
Gosh, nullish one was literally life changing ✌🏽 Thank you!!
I only sometimes use javascript so I never heard about optional chaining. This is huge!
Ohh yes, I felt soo good after I used in my project earlier this month. It felt liberating 😍😍
I'm going to use this to restructure my whole codebase. Awesome.👍
I changed mission to python for more than a year now, but everytime you release a video i want to go back to js !
That was the most I have learnt about programming in 100 seconds!
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 :)
Woooow this was useful, nullish coalescing is gonna save me so many try()'s
Thank you. Short vid and gives much knowledge. Saw lots of these ternary expression used in codewars
I can’t wait for your NextJS firebase course!
2021 Jeff is on a roll with these videos 🔥
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
Erlang has entered the chat… 😁
Freaking love the ternary operator!!
You really make some crazy good tuts man.
Wow, didn't know about that last case. Thanks for sharing.
This solves 2 problems very efficiently.
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!
the other two ways are not ternary operator
Minor nitpick, the token for optional chaining is '?.', question mark and a dot, they both replace the normal dot.
Either way, great overview
YOU'VE BLOWN MY MIND!!!!
Thanks, didn't know about Nullish Coalescing :)
Awesome video Jeff!
Great video, as always!
Thank you for wrapping this info nicely
Being a C# Developer, it feels great to see these changes in JS
This is fantastic! Great job!
i fucking love these shorts
Again, another awesome video 😎
Thank you! I use all of them when I code
This is exactly what I needed.
Thanks!
so much information....makes me happy.
Amazing Sir 💫💫
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.!
Mind blown in 100 seconds.
@fireship I LOVE YOUR CHANNEL!
You are great, you are fast that's why
easy to understand, && save time.
This was actually really helpful, thank you!
when I learned ternary operator, it was life changing.
I LOVE the ? expression ❤️
Awesome vid!
Those days I used the ternary operator in school just to confuse the hell out teachers.
Thank you... The second one is definitely life changing.
i needed this. thank you.
The optional chaining and nullish coalescing features are available since ECMA script 2020.
Available since:
- Chrome 80
- iOS Safari 13.4
- Node.js 14.0.0
- TypeScript 3.7
Thanks, great explanation!
Thank you so much for making a video on optional chaining and bullish coalescing; these methods can be challenging to find info about as they're still quite new and "? javascript" doesn't return much of anything useful when doing a search.
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.☺👍
Great video as always
love these type of videos
amazin explanation good job
More flutter please!! Btw great video
i'm pretty sure the analog for this in lua is "condition and truthyValue or falsyValue" since it basically works the same
Thank you, Please do more handy tips🔥
Rust has no ternary but it's if statements can return values so you can do "let foo=if(a>b)bar else 0;”
Flawlessly created!
Love the outro
GOD DAMN it is insanely helpful
0:00 Citation needed. What about the dot, comma, parentheses, braces, brackets, equal sign…?
The only useful characters in JS are []()+!
Nothing else is needed
I would love a video comparing and contrasting dart and js.
I think he already did one
ruclips.net/video/7sJZi0grFR4/видео.html
The optional chaining is called Nullsafe operator in langs like csharp and php and many other langs
“Elvis” operator in Ruby
don't forget about `??=`! super nice to have next to the other conditional assignment operators
eg. `x ??= y`becomes equivalent to `x ?? (x = y)`
Brilliant, as always!
Nice video! What about FBC14 algorithm review?
You don't have to tell me to hit the like button,
I always learn something new
I always hit like♥️🤩
Great Video (as always)! I've never been able to figure out - whats the VS Code theme and material icon theme that you use?
Theme and icons are in video description
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.