? in NaN Seconds

Поделиться
HTML-код
  • Опубликовано: 6 янв 2025

Комментарии • 297

  • @gradientO
    @gradientO 4 года назад +360

    You changed the title from
    _" JS ? in 100 seconds"_ to
    _" ? in NaN seconds"_
    Cool

    • @amine_akad
      @amine_akad 4 года назад +17

      Maybe RUclips's script didn't recognise "100" and displayed NaN instead

    • @thos3474
      @thos3474 4 года назад +7

      @@amine_akad It's due to the fact the video is longer than 100 seconds

    • @Fireship
      @Fireship  4 года назад +83

      I think "? in NaN seconds" has a better ring to it

    • @amine_akad
      @amine_akad 4 года назад +1

      @@thos3474 ikr, my reply was sarcastic

    • @oskrm
      @oskrm 4 года назад +4

      @@Fireship has a better [object] to it

  • @girllovescoding
    @girllovescoding 3 года назад +4

    It feels like I was waiting my whole life for JS to introduce optional chaining. Thanks for a great video!

  • @hsemog
    @hsemog 4 года назад +158

    Hey Jeff,
    We need a “Fireship answers in 100 seconds” 😄

    • @KangJangkrik
      @KangJangkrik 3 года назад +1

      Can't wait until someone ask face reveal

  • @GoodVolition
    @GoodVolition 4 года назад +157

    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 4 года назад +6

      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 года назад +1

      The ternary is still worse than rust-y if case expressions.

  • @duuhhveeed
    @duuhhveeed 4 года назад +23

    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 4 года назад +3

      Same here, down with (foo || {}).bar

  • @IanSfirebirdflame
    @IanSfirebirdflame 4 года назад +39

    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  4 года назад +12

      Glad I could help!

  • @y9tw0t
    @y9tw0t 4 года назад +48

    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_ .

    • @MatthewTaylor86
      @MatthewTaylor86 4 года назад +9

      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"

    • @Nif3
      @Nif3 4 года назад +4

      @@MatthewTaylor86 Same here, I found you guys' comments while trying to make sure.

  • @CodingWithLewis
    @CodingWithLewis 4 года назад

    Love your videos. Very proud to say that I am here before you hit 1 million subs.

  • @stealthysubie
    @stealthysubie 4 года назад +4

    I'm a an experience developer and I actually learned something. Great videos as always!

  • @mirandamoralez6354
    @mirandamoralez6354 3 года назад

    depth, sound, voice - so great always! THX A LOT!

  • @realgarmingo
    @realgarmingo 4 года назад +24

    This channel is amazingly helpful. Thanks.

  • @Nintron
    @Nintron 4 года назад

    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!

  • @akashmelkeri
    @akashmelkeri 2 года назад

    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

  • @mycloudvip
    @mycloudvip 4 года назад

    We’re are here to stay. We love your 100 Sec. Videos. Thumbs up

  • @reyanrahman
    @reyanrahman 4 года назад

    U have no idea how much time this little question mark will save thank you so much keep making more shorts like this

  • @aleksandarstevanovic5854
    @aleksandarstevanovic5854 4 года назад

    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!

  • @othman_
    @othman_ 4 года назад

    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.

  • @TudoSempre
    @TudoSempre 4 года назад

    I definitely don't get tired of watching your videos.

  • @rafaelpernil
    @rafaelpernil 3 года назад

    I use those daily and they really make JS much more enjoyable and concise

  • @ExtremeGamer109715
    @ExtremeGamer109715 3 года назад

    Subscribing to this channel was the best choice ever!

  • @lukehatcher98
    @lukehatcher98 4 года назад +1

    Wow nullish coalescing sounds amazing. I’m gonna start using that right away 🤩

  • @neeeeeck9005
    @neeeeeck9005 4 года назад

    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.

  • @mirkosedda3196
    @mirkosedda3196 4 года назад

    These videos are more valuable than they are short.. just brilliant job!

  • @ark5458
    @ark5458 4 года назад +131

    should be: js in NaN seconds

  • @TehLostGamers
    @TehLostGamers 4 года назад

    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!!!

  • @Chiefsosa17
    @Chiefsosa17 4 года назад +8

    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  4 года назад +3

      I agree, it's just a common criticism when people first encounter them.

    • @softwarelivre2389
      @softwarelivre2389 4 года назад +2

      @@Fireship sometimes I even chain ternaries, like:
      cond > 100 ? '#FFFFFF' :
      cond > 80 ? '#999999':
      cond > 30 ? '#444444':
      '#181818';

    • @Chiefsosa17
      @Chiefsosa17 4 года назад

      @@softwarelivre2389 I dont this this is too bad either, but couldn't this be turned in a Switch statement then?

    • @tomebundalevski1872
      @tomebundalevski1872 4 года назад +2

      @@Chiefsosa17 no

    • @softwarelivre2389
      @softwarelivre2389 4 года назад

      @@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.

  • @Musaakdaag12
    @Musaakdaag12 4 года назад

    Thanks i knew about Michael Hill! He was my professor in Oxford and told us about FBC14 algorithm!

  • @octagonalt7311
    @octagonalt7311 4 года назад +6

    i love videos like these, keep it up!

  • @klutch4198
    @klutch4198 4 года назад

    the most powerful 100 seconds video yet

  • @diete103
    @diete103 4 года назад

    I thank you so much for this video because optional changing is something I didn't know I needed in my life!!!!

  • @suman-majhi
    @suman-majhi 4 года назад +2

    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

  • @ThePayanazo
    @ThePayanazo 4 года назад

    Thanks for this man, i appreciate your teaching, for a person who is starting in this, this is literally gold.

  • @valentincamus8343
    @valentincamus8343 3 года назад

    Thank you very much for the optional chaining !

  • @iancuvlad7368
    @iancuvlad7368 4 года назад +7

    1:42 That Kotlin feeling...

  • @kylemckell
    @kylemckell 4 года назад +1

    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 4 года назад +1

      Unreliable APIs are hell on earth without optional chaining. Been through that path, my friend, and it is indeed not beautiful.

  • @RonDLite
    @RonDLite 4 года назад

    Best title in ages, great start of the weekend

  • @chiefkanakana
    @chiefkanakana 4 года назад

    Gosh, nullish one was literally life changing ✌🏽 Thank you!!

  • @TheSuperSausageDog
    @TheSuperSausageDog 4 года назад

    I only sometimes use javascript so I never heard about optional chaining. This is huge!

  • @TheRealKitWalker
    @TheRealKitWalker 4 года назад +1

    Ohh yes, I felt soo good after I used in my project earlier this month. It felt liberating 😍😍

  • @watchocho2660
    @watchocho2660 4 года назад

    I'm going to use this to restructure my whole codebase. Awesome.👍

  • @nyghtseven
    @nyghtseven 4 года назад

    I changed mission to python for more than a year now, but everytime you release a video i want to go back to js !

  • @edencheung8468
    @edencheung8468 4 года назад

    That was the most I have learnt about programming in 100 seconds!

  • @thebaconbreadful
    @thebaconbreadful 4 года назад

    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 :)

  • @nothingnoone8752
    @nothingnoone8752 4 года назад +2

    Woooow this was useful, nullish coalescing is gonna save me so many try()'s

  • @kenji1366
    @kenji1366 4 года назад

    Thank you. Short vid and gives much knowledge. Saw lots of these ternary expression used in codewars

  • @aidenyang747
    @aidenyang747 4 года назад

    I can’t wait for your NextJS firebase course!

  • @mo99
    @mo99 4 года назад

    2021 Jeff is on a roll with these videos 🔥

  • @adambickford8720
    @adambickford8720 4 года назад +1

    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 Год назад

      Erlang has entered the chat… 😁

  • @nathanielyoung
    @nathanielyoung 4 года назад

    Freaking love the ternary operator!!

  • @ChessFlix
    @ChessFlix 4 года назад

    You really make some crazy good tuts man.

  • @complex5372
    @complex5372 4 года назад

    Wow, didn't know about that last case. Thanks for sharing.

  • @JandyCZ
    @JandyCZ 4 года назад

    This solves 2 problems very efficiently.

  • @CorruptedPixl
    @CorruptedPixl 4 года назад +1

    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!

  • @TheRanguna
    @TheRanguna 4 года назад

    Minor nitpick, the token for optional chaining is '?.', question mark and a dot, they both replace the normal dot.
    Either way, great overview

  • @JeffPohlmeyer
    @JeffPohlmeyer 4 года назад

    YOU'VE BLOWN MY MIND!!!!

  • @pierluigiomargiancola7388
    @pierluigiomargiancola7388 4 года назад

    Thanks, didn't know about Nullish Coalescing :)

  • @0xcoburn
    @0xcoburn 4 года назад

    Awesome video Jeff!

  • @nerf66770
    @nerf66770 3 года назад

    Great video, as always!
    Thank you for wrapping this info nicely

  • @chinmaypadole9080
    @chinmaypadole9080 4 года назад

    Being a C# Developer, it feels great to see these changes in JS

  • @letsbuildseries
    @letsbuildseries 4 года назад

    This is fantastic! Great job!

  • @7asyou
    @7asyou 4 года назад

    i fucking love these shorts

  • @allisonmachado
    @allisonmachado 2 года назад

    Again, another awesome video 😎

  • @sanzhar.danybayev
    @sanzhar.danybayev 4 года назад

    Thank you! I use all of them when I code

  • @RoosterLewis
    @RoosterLewis 4 года назад

    This is exactly what I needed.
    Thanks!

  • @akifimran9780
    @akifimran9780 3 года назад

    so much information....makes me happy.

  • @kuldipthakkar1508
    @kuldipthakkar1508 4 года назад

    Amazing Sir 💫💫

  • @snithfferx
    @snithfferx 11 месяцев назад

    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.!

  • @AutisticThinker
    @AutisticThinker 4 года назад

    Mind blown in 100 seconds.

  • @vcoppolecchia
    @vcoppolecchia 4 года назад

    @fireship I LOVE YOUR CHANNEL!

  • @a29stech33
    @a29stech33 4 года назад

    You are great, you are fast that's why
    easy to understand, && save time.

  • @mattoattacko
    @mattoattacko 4 года назад

    This was actually really helpful, thank you!

  • @daleryanaldover6545
    @daleryanaldover6545 4 года назад +1

    when I learned ternary operator, it was life changing.

  • @lawlessfpv
    @lawlessfpv 4 года назад

    I LOVE the ? expression ❤️

  • @arielmorningstar3399
    @arielmorningstar3399 4 года назад

    Awesome vid!

  • @user-he4ef9br7z
    @user-he4ef9br7z 4 года назад +5

    Those days I used the ternary operator in school just to confuse the hell out teachers.

  • @KarteekRakshit
    @KarteekRakshit 4 года назад

    Thank you... The second one is definitely life changing.

  • @CrackThrough
    @CrackThrough 4 года назад

    i needed this. thank you.

  • @sanori-cs
    @sanori-cs 4 года назад

    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

  • @marcopetaccia88
    @marcopetaccia88 4 года назад

    Thanks, great explanation!

  • @kawcco
    @kawcco 4 года назад

    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.

  • @mohanaggarwal4058
    @mohanaggarwal4058 4 года назад

    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.☺👍

  • @Muaddibkhan
    @Muaddibkhan 4 года назад

    Great video as always

  • @aryan2628
    @aryan2628 4 года назад

    love these type of videos

  • @pantanom18
    @pantanom18 4 года назад

    amazin explanation good job

  • @andrejvujic
    @andrejvujic 4 года назад +1

    More flutter please!! Btw great 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

  • @anil__k
    @anil__k 4 года назад

    Thank you, Please do more handy tips🔥

  • @_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;”

  • @shubhranildutta9564
    @shubhranildutta9564 4 года назад

    Flawlessly created!

  • @itzmeB2
    @itzmeB2 4 года назад

    Love the outro

  • @heibam
    @heibam 4 года назад

    GOD DAMN it is insanely helpful

  • @31redorange08
    @31redorange08 4 года назад

    0:00 Citation needed. What about the dot, comma, parentheses, braces, brackets, equal sign…?

    • @seanthesheep
      @seanthesheep 4 года назад

      The only useful characters in JS are []()+!
      Nothing else is needed

  • @MythiPlayz
    @MythiPlayz 4 года назад

    I would love a video comparing and contrasting dart and js.

    • @albertbennett6290
      @albertbennett6290 4 года назад

      I think he already did one
      ruclips.net/video/7sJZi0grFR4/видео.html

  • @abdo.magdy.
    @abdo.magdy. 4 года назад

    The optional chaining is called Nullsafe operator in langs like csharp and php and many other langs

    • @Roboprogs
      @Roboprogs Год назад

      “Elvis” operator in Ruby

  • @Sxxov
    @Sxxov 4 года назад

    don't forget about `??=`! super nice to have next to the other conditional assignment operators
    eg. `x ??= y`becomes equivalent to `x ?? (x = y)`

  • @DanishShakeel
    @DanishShakeel 4 года назад

    Brilliant, as always!

  • @ayberkkoyuncu4147
    @ayberkkoyuncu4147 4 года назад

    Nice video! What about FBC14 algorithm review?

  • @ninjaasmoke
    @ninjaasmoke 4 года назад

    You don't have to tell me to hit the like button,
    I always learn something new
    I always hit like♥️🤩

  • @jonlothar6126
    @jonlothar6126 4 года назад +5

    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 4 года назад

      Theme and icons are in video description

  • @paulwhiterabbit
    @paulwhiterabbit 4 года назад

    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.