What is THIS in JavaScript? in 100 seconds

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 มี.ค. 2020
  • Learn what the "this" keyword does in JavaScript in 100 seconds. And stay tuned for a few minutes of more advanced discussion after the credits.
    #javascript #100SecondsOfCode
    Install the quiz app 🤓
    iOS itunes.apple.com/us/app/fires...
    Android play.google.com/store/apps/de...
    Upgrade to Fireship PRO at fireship.io/pro
    Use code lORhwXd2 for 25% off your first payment.
    My VS Code Theme
    - Atom One Dark
    - vscode-icons
    - Fira Code Font
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 355

  • @upperarmhumor
    @upperarmhumor 4 ปีที่แล้ว +656

    The extension to the 100 seconds is great, keep doing that.

    • @Fireship
      @Fireship  4 ปีที่แล้ว +32

      Glad you liked it :)

    • @rogadev
      @rogadev 4 ปีที่แล้ว +5

      isGreat(this.100seconds.extension) returns true.

    • @maxencedc
      @maxencedc 3 ปีที่แล้ว +1

      @@rogadev nope, you can't have numbers as a property, a more convenient way of doing this would be isGreate(this["100seconds"].extension) ;)

    • @avinashthakur80
      @avinashthakur80 2 ปีที่แล้ว

      @@maxencedc While fixing one bug, you created another.
      Its "isGreat"

    • @maxencedc
      @maxencedc 2 ปีที่แล้ว

      @@avinashthakur80 You're right. But it's a typo whereas his wasn't

  • @joffarex
    @joffarex 4 ปีที่แล้ว +183

    *sees title*
    *sees video length*
    *confused screaming*

    • @Fireship
      @Fireship  4 ปีที่แล้ว +22

      Watching more than 100 seconds is completely optional (but highly recommended).

    • @danielelkins247
      @danielelkins247 4 ปีที่แล้ว +2

      @@Fireship nah, it's a cheap clickbait tactic.

    • @Verdoyant933
      @Verdoyant933 4 ปีที่แล้ว +10

      @@danielelkins247 what ? how is this clickbait are you braindead ?

    • @abhisheksdhakad2630
      @abhisheksdhakad2630 4 ปีที่แล้ว +10

      @@danielelkins247 if you don't want the knowledge then you can just go away

    • @Knee-Lew
      @Knee-Lew 3 ปีที่แล้ว +3

      @@danielelkins247 do you want some attention?
      Now you've done it.
      Obviously this is only optional, if you don't like it, just unsubscribe. Simple.

  • @DRLgaming
    @DRLgaming 4 ปีที่แล้ว +271

    This is by far the most succinct and clear explanation of `this` that I've seen to date. Great work as always!

    • @lucasfelipe-ze5sy
      @lucasfelipe-ze5sy 4 ปีที่แล้ว +5

      Learning THIS before this videos: 😰
      After this video: 😎

    • @UmarHamza
      @UmarHamza 4 ปีที่แล้ว +4

      Agreed

    • @Hacking-NASSA-with-HTML
      @Hacking-NASSA-with-HTML ปีที่แล้ว

      Did you even try to run that code???? IT DOESN'T WORK !!!!

  • @joncoedisko
    @joncoedisko 11 หลายเดือนก่อน +5

    I have lost out in interviews because, although having a conceptual understanding, I could not properly articulate all of .. uh.. this. This this video nails it, and I feel that much more confident. Best six minutes I've spent on anything ... uh.. this.. week.

  • @TheRyanSmee
    @TheRyanSmee 4 ปีที่แล้ว +132

    😯He went over 100 seconds.. I didn't know that was allowed haha. I actually really like the 100 seconds prefaces with in depth breakdown to follow 🔥

    • @Fireship
      @Fireship  4 ปีที่แล้ว +25

      Sweet! I'm hoping throw in more extended segments in the future.

    • @TheRyanSmee
      @TheRyanSmee 4 ปีที่แล้ว +2

      I look forwards to them man! Me and all the devs at work watch your videos religiously!

    • @mishrasidhant
      @mishrasidhant 4 ปีที่แล้ว +1

      I second this, please do in depth follow ups, your videos are beyond bomb.

    • @mishrasidhant
      @mishrasidhant 4 ปีที่แล้ว +3

      I'm trying to spread your videos to others, instead of corona, your channel should be pandemic.

    • @Hacking-NASSA-with-HTML
      @Hacking-NASSA-with-HTML ปีที่แล้ว

      just a paid comment I believe ????? Did you even try to run that code???? IT DOESN'T WORK !!!!

  • @pedroleite2182
    @pedroleite2182 4 ปีที่แล้ว +1

    I love 100 seconds videos but the possibility of having a deeper explanation... just amazing! Thank you!!

  • @jayanths1221
    @jayanths1221 4 ปีที่แล้ว +26

    Been a Javascript developer for almost 2 years and I finally realized the difference between bind() and call(). I always thought they were exactly the same functions with the only difference being call() accepts function parameters..

    • @Fireship
      @Fireship  4 ปีที่แล้ว +9

      Those 3 methods are hard to keep straight.

    • @Technizor
      @Technizor 4 ปีที่แล้ว +4

      @@Fireship The ABCs of JS functions...

    • @Gustavo-ye1ko
      @Gustavo-ye1ko 4 ปีที่แล้ว +2

      keep it up, I've been working with JS for 6 years now and I can tell you this... it was worth the time :)

    • @Hacking-NASSA-with-HTML
      @Hacking-NASSA-with-HTML ปีที่แล้ว

      just a paid comment I believe ????? Did you even try to run that code???? IT DOESN'T WORK !!!!

  • @soheilrashidi1605
    @soheilrashidi1605 4 ปีที่แล้ว +1

    The extended part after the quick introduction is amazing !!!!!!

  • @abdullahawisimulaha
    @abdullahawisimulaha 3 ปีที่แล้ว +1

    one of not many channels creators who I watch with normal speed and stops on some topics. Lot of content, respect

  • @zenitzo
    @zenitzo ปีที่แล้ว +3

    i need more videos explaining things in 397 seconds lol, absolutely loved it. I am new to the front end world and this channel has helped me so much, LOVE YOU GUYS

  • @ceriusgeek2749
    @ceriusgeek2749 4 ปีที่แล้ว +2

    This is probably the best explanation I've seen on the 'this' keyword, .bind(), .call(), and .apply().

  • @mcny40
    @mcny40 4 ปีที่แล้ว

    I love the extra portion. I hope you’ll keep adding it when it’s pertinent. Thanks for the fabulous work!

  • @valquirsouza1329
    @valquirsouza1329 ปีที่แล้ว +3

    I've watched the whole thing and this went way over my head

  • @sherllock2048
    @sherllock2048 4 ปีที่แล้ว

    The last 5 seconde of the video blew my mind, great job,keep extending your 100sec series please

  • @himanshukumar-kn6ru
    @himanshukumar-kn6ru 4 ปีที่แล้ว +1

    Excellent explanation! I'm so happy that it went beyond 100 seconds. 🔥

  • @mohammadimran2219
    @mohammadimran2219 4 ปีที่แล้ว +48

    3:29 "In an arrow function this is based on the enclosing object's execution context"
    brain.exe has stopped running

    • @amiralam1786
      @amiralam1786 4 ปีที่แล้ว

      XD

    • @grgry06
      @grgry06 3 ปีที่แล้ว

      i agree.

    • @inklingboi8431
      @inklingboi8431 3 ปีที่แล้ว +1

      with this he meant the lexical scope, or from where the function was called, since the method was called in the global scope, its execution context was global :3

    • @adnanbadshah3425
      @adnanbadshah3425 3 ปีที่แล้ว

      It means two level up from the current function scope

    • @undefinedvariable8085
      @undefinedvariable8085 2 ปีที่แล้ว

      MyThinking server has gone away

  • @julienwickramatunga7338
    @julienwickramatunga7338 4 ปีที่แล้ว +1

    +1 for the extension concept!
    Thank you for the good work!

  • @tajpouria
    @tajpouria 4 ปีที่แล้ว +4

    I love this extra segment bro

  • @namikbatra4094
    @namikbatra4094 4 ปีที่แล้ว +16

    Wow thanks for including my name.
    P.S :- Loving the 100 sec series. It's something I have been recommending people before and interview or when I have to give some learning reference material before the allocation of work for interns in our company

    • @Fireship
      @Fireship  4 ปีที่แล้ว +6

      Thanks for the suggestions! Glad to hear your team is finding them useful :)

    • @Hacking-NASSA-with-HTML
      @Hacking-NASSA-with-HTML ปีที่แล้ว

      just a paid comment I believe ????? Did you even try to run that code???? IT DOESN'T WORK !!!!

  • @lcssbr
    @lcssbr 4 ปีที่แล้ว

    Sometimes 100 seconds isn't enough to give a good understanding about a subject, so with the extension part, the video got more interesting. Thanks for the video!

  • @dominik1023
    @dominik1023 3 ปีที่แล้ว

    Nice, 100 seconds that take a week to unpack. Great job!

  • @loka2011eslam
    @loka2011eslam 4 ปีที่แล้ว

    Love this extra segment and as usual the perfect content

  • @riddixdan5572
    @riddixdan5572 4 ปีที่แล้ว +1

    Love it :D, keep em coming. I need more!!!!

  • @0mdshuvo0
    @0mdshuvo0 4 ปีที่แล้ว +1

    Thank you so much for making this so early 💓

  • @vinos1629
    @vinos1629 4 ปีที่แล้ว +9

    These r great but I love the longer vids where u make smth from scratch . It's great to see how stuff Is implemented and stuff and there are a lot of great tips in there

    • @Fireship
      @Fireship  4 ปีที่แล้ว +2

      I hear you, trying to do a mix of both formats.

    • @Hacking-NASSA-with-HTML
      @Hacking-NASSA-with-HTML ปีที่แล้ว

      just a paid comment I believe ????? Did you even try to run that code???? IT DOESN'T WORK !!!!

  • @Soremwar
    @Soremwar 4 ปีที่แล้ว +32

    When are you gonna make a video on Deno?
    Also, that last chaining tip is a BOMB

    • @Fireship
      @Fireship  4 ปีที่แล้ว +6

      I am, it's on my list and I've messed around with it a little bit. Not saying chaining is something you should do, just showing how it works.

    • @Soremwar
      @Soremwar 4 ปีที่แล้ว

      @@Fireship Actually just needed some Capitals to gain some attention. Not something I do either
      Glad to hear that :)

    • @elgalas
      @elgalas 4 ปีที่แล้ว +1

      Builder pattern is the bomb

    • @MaxCoplan
      @MaxCoplan 4 ปีที่แล้ว

      What about Deno?

  • @kaidenrogers
    @kaidenrogers 4 ปีที่แล้ว

    Yes, I love we got the best of both worlds here, For those who need a refresher, we don't need to scrub through the video to find what we need, it's right there at the beginning, and if we need more information we can keep watching for a deeper dive without having to go find another video on the subject where the quality likely wouldn't come close to the quality of your videos. Keep making great stuff man, I love you(not weirdly, I swear) for it.

  • @cmdv42
    @cmdv42 3 ปีที่แล้ว

    Liking the encore beyond 100 seconds - great visuals in every video!

  • @auguwu
    @auguwu 4 ปีที่แล้ว +4

    Excellent video, Jeff! I love the speed in the beginning and the slow part for people who can't understand under 100 seconds of a topic. Keep it up as always!

    • @Hacking-NASSA-with-HTML
      @Hacking-NASSA-with-HTML ปีที่แล้ว

      just a paid comment I believe ????? Did you even try to run that code???? IT DOESN'T WORK !!!!

  • @ValchyGaming
    @ValchyGaming 4 ปีที่แล้ว +1

    I love the new segment keep it up :)

  • @wontonfuton
    @wontonfuton 4 ปีที่แล้ว +1

    Yesss, *this* format of the video is very nice!

  • @ankushsharma3181
    @ankushsharma3181 4 ปีที่แล้ว

    I mean I am hooked to your videos, this might be the best series I saw in a while along with money heist!

  • @sagnikpradhan3594
    @sagnikpradhan3594 4 ปีที่แล้ว

    Can I ever stop getting impressed of your videos?

  • @elanza48
    @elanza48 4 ปีที่แล้ว

    the explanation of bind() context to this keyword is very usefull. I have seen many other tutorials, but they just code it and show What is the output, instead of describing the functionality.
    Once again thanks 😊

  • @alastairm-e3967
    @alastairm-e3967 4 ปีที่แล้ว +1

    Really like the extension on the 100 second videos.

  • @Jam_Spam
    @Jam_Spam 4 ปีที่แล้ว

    Great style of teaching fast general introduction to the topic then a slower paced deeper explanation

  • @trusterzero6399
    @trusterzero6399 4 ปีที่แล้ว

    always go beyond dude, love it

  • @zakhariihusar6975
    @zakhariihusar6975 3 ปีที่แล้ว

    I love this channel, always straight to the point 👍👍👍

  • @DineshKumar-im5lg
    @DineshKumar-im5lg 3 ปีที่แล้ว

    U have just said things that I have been learning for past 1 month in 6 min great man.. 🔥

  • @mahmudul-hasan-sreejon
    @mahmudul-hasan-sreejon 4 ปีที่แล้ว

    I find `this` video great and would like to see more "100 seconds + Breakdown" type videos in the future.

  • @paritoshbatish9984
    @paritoshbatish9984 4 ปีที่แล้ว

    The extension was great. Especially for someone new at core concepts of js

  • @alejkun4923
    @alejkun4923 4 ปีที่แล้ว +1

    Hi Jeff,
    I admire the way you can explain things in such an efficient, fun and pleasant way.
    What is your mental model and strategy for teaching?
    Have you considered making a video about it?
    Thanks for all the great high quality content, and the inspiration!

  • @ragan1425
    @ragan1425 4 ปีที่แล้ว +1

    great (397 sec) video! must-see for JS developers, clear as crystal 👍🏻

  • @sebbes333
    @sebbes333 4 ปีที่แล้ว

    The "extra time" after 100 seconds is really helpful :D

  • @pobodjjd
    @pobodjjd 4 ปีที่แล้ว

    The extension is awesome! Big like!

  • @optimusdebugger9638
    @optimusdebugger9638 4 ปีที่แล้ว +1

    I love this extended version of 100s

  • @LaLa0wng3
    @LaLa0wng3 4 ปีที่แล้ว +1

    Thank you for your amazing and informative content.

  • @ALXG
    @ALXG 3 ปีที่แล้ว

    THIS...
    is an amazing video explanation!

  • @paolodisintegra
    @paolodisintegra 4 ปีที่แล้ว

    this (the video) is pretty usefull because it can help mid to senior developer with interviews since the execution context is a common question out there

  • @UmarHamza
    @UmarHamza 4 ปีที่แล้ว +1

    I like that youv'e gone beyond 100 seconds and broke this down 👌

  • @adoniakazemzadeh
    @adoniakazemzadeh 4 ปีที่แล้ว

    Thank bro this was the best and shortest explanation about this. great job.

  • @user-ug5eo5gf4c
    @user-ug5eo5gf4c 3 ปีที่แล้ว

    Great content man, "This" has been a nightmare to learn and I can say I am starting to get my head around it now

  • @pratyaybanerjee8574
    @pratyaybanerjee8574 4 ปีที่แล้ว +1

    Loved this Jeff

  • @dominiclapitan8466
    @dominiclapitan8466 4 ปีที่แล้ว +1

    I literally clapped after watching this 😉 video. Great work as always!

  • @RaviYadav-bt2eg
    @RaviYadav-bt2eg 4 ปีที่แล้ว +1

    Thanks for fulfilling my request 🙌

  • @bennettfoley3018
    @bennettfoley3018 4 ปีที่แล้ว

    fantastic lecture. thanks for the content!

  • @JohnJohnson-ds4ui
    @JohnJohnson-ds4ui 4 ปีที่แล้ว

    Awesome video!! It took a while for me to grasp the concept of "this", but your explanation helps a lot! 🔥🔥🔥

    • @Hacking-NASSA-with-HTML
      @Hacking-NASSA-with-HTML ปีที่แล้ว

      just a paid comment I believe ????? Did you even try to run that code???? IT DOESN'T WORK !!!!

  • @HardySHD
    @HardySHD 4 ปีที่แล้ว

    i definetly like this extra segment!

  • @itsRAWRtime007
    @itsRAWRtime007 4 ปีที่แล้ว

    Keep the extensions for sure !
    Please do some series on functional patterns in js.

  • @compton8301
    @compton8301 4 ปีที่แล้ว +1

    I love the extension.

  • @Flynn1411
    @Flynn1411 4 ปีที่แล้ว

    This video really have me new info about this

  • @joecat8743
    @joecat8743 ปีที่แล้ว +1

    wow, i learned a lot from this

  • @meliudaj
    @meliudaj 2 ปีที่แล้ว

    Seriously, nobody has counted how many times this is said in this video about this? This is inconceivable. 🙂

  • @Somberland
    @Somberland 4 ปีที่แล้ว +1

    Ah I love „this“ beyond 100 seconds :) nice idea

  • @compton8301
    @compton8301 4 ปีที่แล้ว

    Favourite channel. Favourite teacher.

  • @ucuphanakstig
    @ucuphanakstig 4 ปีที่แล้ว

    we need that beyond 100 seconds section in every 100-second video

  • @kakhan2086
    @kakhan2086 4 ปีที่แล้ว

    The extended part is great 👌

  • @kishanvaghasia4059
    @kishanvaghasia4059 4 ปีที่แล้ว

    hey i like this beyond 100 sec video. Keep making this and make explanations as simple as this is other videos too

  • @thriftykapila8420
    @thriftykapila8420 4 ปีที่แล้ว +5

    Quality content is valued, video length doesn't matter just keep it tight and crisp as always😍😍😍👏🏼👏🏼👏🏼 big fan, are you on Instagram as well?

    • @Fireship
      @Fireship  4 ปีที่แล้ว

      Thank you! on IG as fireship_dev

    • @Hacking-NASSA-with-HTML
      @Hacking-NASSA-with-HTML ปีที่แล้ว

      just a paid comment I believe ????? Did you even try to run that code???? IT DOESN'T WORK !!!!

  • @gumbo64
    @gumbo64 4 ปีที่แล้ว

    I can tell this is important so I'll save this for when I need it

  • @e-benz
    @e-benz 4 ปีที่แล้ว

    Method chaining is real mindblower

  • @juliohintze595
    @juliohintze595 4 ปีที่แล้ว

    Sometimes I think I don't understand "this", but learned to get around it with binds and arrow function.

  • @adarshnayak6803
    @adarshnayak6803 2 ปีที่แล้ว

    Really informational I loved it

  • @gregorqu
    @gregorqu ปีที่แล้ว

    I did not understand much, but thank you for this video!

  • @vambach
    @vambach 4 ปีที่แล้ว +1

    That part about chaining 💙

  • @Programming-Fun-With-Hima
    @Programming-Fun-With-Hima 4 ปีที่แล้ว

    I really love this GREATE CHANNEL

  • @raamm10
    @raamm10 4 ปีที่แล้ว

    i like the 100 second overview first and then indepth look later.

  • @alibarznji2000
    @alibarznji2000 4 ปีที่แล้ว

    I love your work,
    could you make a video on node and express please

  • @davidralph
    @davidralph 4 ปีที่แล้ว

    Another excellent video!

  • @reservationdetails8550
    @reservationdetails8550 4 ปีที่แล้ว

    I love the content past 100 seconds

  • @jakeedgar3076
    @jakeedgar3076 2 ปีที่แล้ว

    Yeah I would love some more videos about "this."

  • @FauzulChowdhury
    @FauzulChowdhury 4 ปีที่แล้ว

    An extension that extended my knowledge. "W😲W" on the last part.

  • @HigkeyRegarded007
    @HigkeyRegarded007 ปีที่แล้ว

    This channel is amazing.

  • @rstark
    @rstark 4 ปีที่แล้ว

    Its better with this extra part, hope u would be continue with this, a bit too fast, for non english native speaker :) Great channel!

  • @sourishdutta9600
    @sourishdutta9600 4 ปีที่แล้ว +9

    WOW!!!! Whenever that notification pop up i received , i feel so happy , streams of knowledge. I just wanted to say thank you Jeff ☺️☺️👍👌. Can you please make one video on Symbol , proxy and other meta programming things. Thanks.

    • @Fireship
      @Fireship  4 ปีที่แล้ว +2

      Thanks for watching, those would make good advanced topics 👍

    • @ben6
      @ben6 4 ปีที่แล้ว

      more like observables of knowledge ;)

  • @mdparvejhasan7040
    @mdparvejhasan7040 4 ปีที่แล้ว

    Yes we want please make another video about this

  • @0x656e
    @0x656e 4 ปีที่แล้ว +1

    I start learning JavaScript today and get your notification ❤

  • @danieljoaquinsegoviacorona1734
    @danieljoaquinsegoviacorona1734 4 ปีที่แล้ว

    liked the long version, try create the extended version of the old 100 secs vids please :D

  • @x9wozz
    @x9wozz 4 ปีที่แล้ว +1

    I've been waiting for this. No pun intended xd

  • @dbwstein
    @dbwstein 2 ปีที่แล้ว

    Thanks!

  • @kevinbellock6825
    @kevinbellock6825 2 ปีที่แล้ว

    this just made my head spin

  • @user-ym8sp2yi1k
    @user-ym8sp2yi1k 2 ปีที่แล้ว

    great video, im still waiting for the video about the "class" keyword ^^

  • @WinningEmpire
    @WinningEmpire 4 ปีที่แล้ว

    Thank you.

  • @Rasecz
    @Rasecz 4 ปีที่แล้ว

    Amazing job. I’m always having to console log this to understand what’s going on. Now I should be able to read a bit better

  • @truthmatters7573
    @truthmatters7573 4 ปีที่แล้ว

    I like the extra bits

  • @srtamim8976
    @srtamim8976 2 ปีที่แล้ว

    Great video...🤩

  • @joroh_
    @joroh_ 4 ปีที่แล้ว +1

    great Videos,
    I hope if you can make a Video about :
    how does the browser actually render a website.

  • @kobenade
    @kobenade 4 ปีที่แล้ว

    Awesome....what vscode theme do you use?

  • @MikeDue
    @MikeDue 9 หลายเดือนก่อน

    Please keep doing the beyond 100 seconds it's awesome!! Also sorry about your mom :(

  • @JordanAF808
    @JordanAF808 3 ปีที่แล้ว

    Not only is Fireship one of the best teachers on the internet, he has the best voice at .75 playback speed! 🔥🔥🔥