? in NaN Seconds

  Рет қаралды 128,318

Fireship

Fireship

Күн бұрын

Пікірлер: 297
@gradientO
@gradientO 3 жыл бұрын
You changed the title from _" JS ? in 100 seconds"_ to _" ? in NaN seconds"_ Cool
@amine_akad
@amine_akad 3 жыл бұрын
Maybe KZbin's script didn't recognise "100" and displayed NaN instead
@thos3474
@thos3474 3 жыл бұрын
@@amine_akad It's due to the fact the video is longer than 100 seconds
@Fireship
@Fireship 3 жыл бұрын
I think "? in NaN seconds" has a better ring to it
@amine_akad
@amine_akad 3 жыл бұрын
@@thos3474 ikr, my reply was sarcastic
@oskrm
@oskrm 3 жыл бұрын
@@Fireship has a better [object] to it
@GoodVolition
@GoodVolition 3 жыл бұрын
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.
@TheNewton
@TheNewton 3 жыл бұрын
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
@pitust
@pitust 3 жыл бұрын
The ternary is still worse than rust-y if case expressions.
@hsemog
@hsemog 3 жыл бұрын
Hey Jeff, We need a “Fireship answers in 100 seconds” 😄
@KangJangkrik
@KangJangkrik 3 жыл бұрын
Can't wait until someone ask face reveal
@IanSfirebirdflame
@IanSfirebirdflame 3 жыл бұрын
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.
@Fireship
@Fireship 3 жыл бұрын
Glad I could help!
@girllovescoding
@girllovescoding 3 жыл бұрын
It feels like I was waiting my whole life for JS to introduce optional chaining. Thanks for a great video!
@realgarmingo
@realgarmingo 3 жыл бұрын
This channel is amazingly helpful. Thanks.
@duuhhveeed
@duuhhveeed 3 жыл бұрын
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
@cicicad
@cicicad 3 жыл бұрын
Same here, down with (foo || {}).bar
@mycloudvip
@mycloudvip 3 жыл бұрын
We’re are here to stay. We love your 100 Sec. Videos. Thumbs up
@Chiefsosa17
@Chiefsosa17 3 жыл бұрын
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
@Fireship
@Fireship 3 жыл бұрын
I agree, it's just a common criticism when people first encounter them.
@softwarelivre2389
@softwarelivre2389 3 жыл бұрын
@@Fireship sometimes I even chain ternaries, like: cond > 100 ? '#FFFFFF' : cond > 80 ? '#999999': cond > 30 ? '#444444': '#181818';
@Chiefsosa17
@Chiefsosa17 3 жыл бұрын
@@softwarelivre2389 I dont this this is too bad either, but couldn't this be turned in a Switch statement then?
@tomebundalevski1872
@tomebundalevski1872 3 жыл бұрын
@@Chiefsosa17 no
@softwarelivre2389
@softwarelivre2389 3 жыл бұрын
@@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.
@ExtremeGamer109715
@ExtremeGamer109715 3 жыл бұрын
Subscribing to this channel was the best choice ever!
@suman-majhi
@suman-majhi 3 жыл бұрын
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_hehe
@quirky_hehe 3 жыл бұрын
I'm a an experience developer and I actually learned something. Great videos as always!
@kylemckell
@kylemckell 3 жыл бұрын
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.
@softwarelivre2389
@softwarelivre2389 3 жыл бұрын
Unreliable APIs are hell on earth without optional chaining. Been through that path, my friend, and it is indeed not beautiful.
@klutch4198
@klutch4198 3 жыл бұрын
the most powerful 100 seconds video yet
@mirandamoralez6354
@mirandamoralez6354 3 жыл бұрын
depth, sound, voice - so great always! THX A LOT!
@reyanrahman
@reyanrahman 3 жыл бұрын
U have no idea how much time this little question mark will save thank you so much keep making more shorts like this
@othman_
@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.
@iancuvlad7368
@iancuvlad7368 3 жыл бұрын
1:42 That Kotlin feeling...
@adambickford8720
@adambickford8720 3 жыл бұрын
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
@Roboprogs
@Roboprogs 9 ай бұрын
Erlang has entered the chat… 😁
@CodingWithLewis
@CodingWithLewis 3 жыл бұрын
Love your videos. Very proud to say that I am here before you hit 1 million subs.
@ark5458
@ark5458 3 жыл бұрын
should be: js in NaN seconds
@Fireship
@Fireship 3 жыл бұрын
I concur!
@ayoubbelmehdi6196
@ayoubbelmehdi6196 3 жыл бұрын
Or undefined in NaN seconds
@ark5458
@ark5458 3 жыл бұрын
Haha, you actually did it
@vallemuller5594
@vallemuller5594 3 жыл бұрын
[object Object]
@Musaakdaag12
@Musaakdaag12 3 жыл бұрын
Thanks i knew about Michael Hill! He was my professor in Oxford and told us about FBC14 algorithm!
@Nintron
@Nintron 3 жыл бұрын
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!
@aleksandarstevanovic5854
@aleksandarstevanovic5854 3 жыл бұрын
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!
@lukehatcher98
@lukehatcher98 3 жыл бұрын
Wow nullish coalescing sounds amazing. I’m gonna start using that right away 🤩
@octagonalt7311
@octagonalt7311 3 жыл бұрын
i love videos like these, keep it up!
@akashmelkeri
@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
@valentincamus8343
@valentincamus8343 3 жыл бұрын
Thank you very much for the optional chaining !
@TudoSempre
@TudoSempre 3 жыл бұрын
I definitely don't get tired of watching your videos.
@JandyCZ
@JandyCZ 3 жыл бұрын
This solves 2 problems very efficiently.
@mirkosedda3196
@mirkosedda3196 3 жыл бұрын
These videos are more valuable than they are short.. just brilliant job!
@neeeeeck9005
@neeeeeck9005 3 жыл бұрын
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.
@TehLostGamers
@TehLostGamers 3 жыл бұрын
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!!!
@nathanielyoung
@nathanielyoung 3 жыл бұрын
Freaking love the ternary operator!!
@diete103
@diete103 3 жыл бұрын
I thank you so much for this video because optional changing is something I didn't know I needed in my life!!!!
@pierluigiomargiancola7388
@pierluigiomargiancola7388 3 жыл бұрын
Thanks, didn't know about Nullish Coalescing :)
@nyghtseven
@nyghtseven 3 жыл бұрын
I changed mission to python for more than a year now, but everytime you release a video i want to go back to js !
@complex5372
@complex5372 3 жыл бұрын
Wow, didn't know about that last case. Thanks for sharing.
@nothingnoone8752
@nothingnoone8752 3 жыл бұрын
Woooow this was useful, nullish coalescing is gonna save me so many try()'s
@sanzhar.danybayev
@sanzhar.danybayev 3 жыл бұрын
Thank you! I use all of them when I code
@rafaelpernil
@rafaelpernil 3 жыл бұрын
I use those daily and they really make JS much more enjoyable and concise
@edencheung8468
@edencheung8468 3 жыл бұрын
That was the most I have learnt about programming in 100 seconds!
@RonDLite
@RonDLite 3 жыл бұрын
Best title in ages, great start of the weekend
@TheRealKitWalker
@TheRealKitWalker 3 жыл бұрын
Ohh yes, I felt soo good after I used in my project earlier this month. It felt liberating 😍😍
@akifimran9780
@akifimran9780 2 жыл бұрын
so much information....makes me happy.
@TheSuperSausageDog
@TheSuperSausageDog 3 жыл бұрын
I only sometimes use javascript so I never heard about optional chaining. This is huge!
@CorruptedPixl
@CorruptedPixl 3 жыл бұрын
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!
@epajarjestys9981
@epajarjestys9981 3 жыл бұрын
the other two ways are not ternary operator
@AutisticThinker
@AutisticThinker 3 жыл бұрын
Mind blown in 100 seconds.
@ThePayanazo
@ThePayanazo 3 жыл бұрын
Thanks for this man, i appreciate your teaching, for a person who is starting in this, this is literally gold.
@watchocho2660
@watchocho2660 3 жыл бұрын
I'm going to use this to restructure my whole codebase. Awesome.👍
@chiefkanakana
@chiefkanakana 3 жыл бұрын
Gosh, nullish one was literally life changing ✌🏽 Thank you!!
@0xcoburn
@0xcoburn 3 жыл бұрын
Awesome video Jeff!
@marcopetaccia88
@marcopetaccia88 3 жыл бұрын
Thanks, great explanation!
@allisonmachado
@allisonmachado 2 жыл бұрын
Again, another awesome video 😎
@chinmaypadole9080
@chinmaypadole9080 3 жыл бұрын
Being a C# Developer, it feels great to see these changes in JS
@mo99
@mo99 3 жыл бұрын
2021 Jeff is on a roll with these videos 🔥
@ChessFlix
@ChessFlix 3 жыл бұрын
You really make some crazy good tuts man.
@daleryanaldover6545
@daleryanaldover6545 3 жыл бұрын
when I learned ternary operator, it was life changing.
@thebaconbreadful
@thebaconbreadful 3 жыл бұрын
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 :)
@kenji1366
@kenji1366 3 жыл бұрын
Thank you. Short vid and gives much knowledge. Saw lots of these ternary expression used in codewars
@vcoppolecchia
@vcoppolecchia 3 жыл бұрын
@fireship I LOVE YOUR CHANNEL!
@CrackThrough
@CrackThrough 3 жыл бұрын
i needed this. thank you.
@lawlessfpv
@lawlessfpv 3 жыл бұрын
I LOVE the ? expression ❤️
@user-he4ef9br7z
@user-he4ef9br7z 3 жыл бұрын
Those days I used the ternary operator in school just to confuse the hell out teachers.
@aidenyang747
@aidenyang747 3 жыл бұрын
I can’t wait for your NextJS firebase course!
@abdo.magdy.
@abdo.magdy. 3 жыл бұрын
The optional chaining is called Nullsafe operator in langs like csharp and php and many other langs
@Roboprogs
@Roboprogs 9 ай бұрын
“Elvis” operator in Ruby
@Muaddibkhan
@Muaddibkhan 3 жыл бұрын
Great video as always
@snithfferx
@snithfferx 7 ай бұрын
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.!
@nerf66770
@nerf66770 3 жыл бұрын
Great video, as always! Thank you for wrapping this info nicely
@andrejvujic
@andrejvujic 3 жыл бұрын
More flutter please!! Btw great video
@_tsu_
@_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;”
@RoosterLewis
@RoosterLewis 3 жыл бұрын
This is exactly what I needed. Thanks!
@JeffPohlmeyer
@JeffPohlmeyer 3 жыл бұрын
YOU'VE BLOWN MY MIND!!!!
@TheRanguna
@TheRanguna 3 жыл бұрын
Minor nitpick, the token for optional chaining is '?.', question mark and a dot, they both replace the normal dot. Either way, great overview
@briandesign
@briandesign 3 жыл бұрын
can't believe I'm this early
@letsbuildseries
@letsbuildseries 3 жыл бұрын
This is fantastic! Great job!
@KarteekRakshit
@KarteekRakshit 3 жыл бұрын
Thank you... The second one is definitely life changing.
@kuldipthakkar1508
@kuldipthakkar1508 3 жыл бұрын
Amazing Sir 💫💫
@EXQEX9
@EXQEX9 3 жыл бұрын
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.
@fidelsule4181
@fidelsule4181 3 жыл бұрын
Nice video glad to be first to watch
@heibam
@heibam 3 жыл бұрын
GOD DAMN it is insanely helpful
@itzmeB2
@itzmeB2 3 жыл бұрын
Love the outro
@MythiPlayz
@MythiPlayz 3 жыл бұрын
I would love a video comparing and contrasting dart and js.
@albertbennett6290
@albertbennett6290 3 жыл бұрын
I think he already did one kzbin.info/www/bejne/baSti5xmnNd5iJY
@pantanom18
@pantanom18 3 жыл бұрын
amazin explanation good job
@mattoattacko
@mattoattacko 3 жыл бұрын
This was actually really helpful, thank you!
@a29stech33
@a29stech33 3 жыл бұрын
You are great, you are fast that's why easy to understand, && save time.
@mohanaggarwal4058
@mohanaggarwal4058 3 жыл бұрын
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.☺👍
@paulwhiterabbit
@paulwhiterabbit 3 жыл бұрын
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.
@jonlothar6126
@jonlothar6126 3 жыл бұрын
Great Video (as always)! I've never been able to figure out - whats the VS Code theme and material icon theme that you use?
@lolownq
@lolownq 3 жыл бұрын
Theme and icons are in video description
@Sxxov
@Sxxov 3 жыл бұрын
don't forget about `??=`! super nice to have next to the other conditional assignment operators eg. `x ??= y`becomes equivalent to `x ?? (x = y)`
@evandroprogram
@evandroprogram 3 жыл бұрын
You forgot the nullish assignment operator (??=) which is also very handy!
@jovan93bl
@jovan93bl 3 жыл бұрын
Another great video, thx
@ninjaasmoke
@ninjaasmoke 3 жыл бұрын
You don't have to tell me to hit the like button, I always learn something new I always hit like♥️🤩
@krozaine
@krozaine 3 жыл бұрын
From Ruby on Rails (RoR) : 1. user.try(:write).try(:code) 2. amount = amount.presence || 23.99
@denzel420
@denzel420 Жыл бұрын
its just gold!
@arielmorningstar3399
@arielmorningstar3399 3 жыл бұрын
Awesome vid!
@ahverypro
@ahverypro 3 жыл бұрын
I love you ternary operator
@shateq
@shateq 3 жыл бұрын
Really cool video
@Chmze799
@Chmze799 2 жыл бұрын
i'm pretty sure the analog for this in lua is "condition and truthyValue or falsyValue" since it basically works the same
@Tw33tMonsta14
@Tw33tMonsta14 3 жыл бұрын
Swift been had this
~/.dotfiles in 100 Seconds
13:54
Fireship
Рет қаралды 419 М.
The JavaScript Survival Guide
14:47
Fireship
Рет қаралды 728 М.
АЗАРТНИК 4 |СЕЗОН 3 Серия
30:50
Inter Production
Рет қаралды 1 МЛН
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 4,8 МЛН
Svelte London - September 2024
Svelte Society
Рет қаралды 12
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
100+ Web Development Things you Should Know
13:18
Fireship
Рет қаралды 1,5 МЛН
7 Web Features You Didn’t Know Existed
10:16
Fireship
Рет қаралды 277 М.
How To Make AWS Not Suck
6:38
Fireship
Рет қаралды 539 М.