Javascript this keyword explained | in Gloable Scope, Object, Function, Prototype, Method, Class

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

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

  • @manukarthikkattepuraramesh2727
    @manukarthikkattepuraramesh2727 6 лет назад +122

    I got a new job because of your tutorials!! Thanks a ton!

    • @HK-sw3vi
      @HK-sw3vi 4 года назад +9

      what happened to the old one?

    • @bob-ny6kn
      @bob-ny6kn 3 года назад +12

      @@HK-sw3vi Released for watching yt videos at work, is my guess.

  • @winstonmisha
    @winstonmisha 5 лет назад +106

    "Today we are going to talk about this keyword."
    "I'm sorry what keyword?" "
    "This keyword."
    "WHAT KEYWORD????"

    • @Techsithtube
      @Techsithtube  5 лет назад +13

      this "this" keyword :)

    • @webmaster246
      @webmaster246 5 лет назад +4

      var that = this;

    • @tommyzDad
      @tommyzDad 5 лет назад +6

      "Not _What_ , _This_ ."

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

      This reminds me of that viral article that said "buffalo buffalo buffalo buffalo buffalo buffalo buffalo" was a grammatically correct sentence

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

      I wish he would say “keyword this” and not just “this” when referring to the keyword, and “here” to speak of some thing instead of using “this” everywhere

  • @slunkeh
    @slunkeh 5 лет назад +30

    Fantastic teacher, this is the best explanation of "this" that I have come across by far. Thank you so much!

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

    You are the best teacher I have found anywhere on the Internet to explain complicated JS topics. Thank you for your videos and clear explanations.

  • @_Spartan-107_
    @_Spartan-107_ 2 года назад +1

    Hey man! Thank you so much for this. I opened my RUclips and went to my "computer programming" page of suggestions. Didn't really know what I was getting into but this was great. You do a very good job of breaking things down in a way that others do not and make things understandable for the lay person!

  • @nikolaykoychev8261
    @nikolaykoychev8261 5 лет назад +1

    Invest in video production meaning changing the quality of your cam(s), the post-production quality as well (meaning video edit) and you'll become a RUclips content creator/programming guru/teacher that is to be admired. Keep doing what you do and one day you'll be one of the top teachers on 'this' platform. You sir, are amazing.

    • @Techsithtube
      @Techsithtube  5 лет назад +3

      Thanks for your feedback . I have recently invested in better equipments. Thanks for an awesome comment.

  • @odorlessflavorless
    @odorlessflavorless 5 лет назад

    "this" channel is a gold mine. As with all gold mines, took a long time to discover!

    • @Techsithtube
      @Techsithtube  5 лет назад

      Ananta, Thanks for an awesome comment.

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

    Extraordinary tutorial. Sets itself apart by covering all use cases of the 'this' keyword.
    My only humble suggestion, is that instead of overwriting on previous example, you could comment out and write the next example underneath. BIG THANKS!!!

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

    OMG, I was not aware of 'this' keyword use case. Thanks alot for improving my skill set. One of the best tutorial on RUclips. Hats off Man.

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

    this was that much beautiful that my knowledge scope global, local and inner is expanded to more than just window. Thank you

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

      Vikramaditya, Thanks for watching. I am glad that you were able to grasp the concept quickly.

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

    BEST EXPLAINATION I HAVE EVER HEARD... VERY WELL DONE SIR...

  • @sajithjulapalli3579
    @sajithjulapalli3579 3 года назад +2

    So glad that I have found your lectures. I had aversion for Javascript, but after started following your tutorials, I really enjoy learning different concepts. Kudos for all the support you are providing.

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

      Sajith, great to hear! Keep on learning!

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

    THID CHANNEL IS LIFE SAVER!

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

    unogona iwe mudzidzisi, you're a great teacher !

  • @Mona001-01g
    @Mona001-01g 5 лет назад

    'this' is indeed a great tutorial. Prevented me from watching 'that' and 'that' and 'that' other tutorial to get 'this' one concept👍👍

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

    Slow, clear, precise, good example, no confusion. Thank you!

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

    'this' is very helpful, I know I'll get tripped up by it again in the future, but I'm feeling more comfortable with it.

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

    Everyone starting to learn JS should see this first - very neat. Thank you techsith, you're a JS Angel :)

  • @somehappyguy6598
    @somehappyguy6598 6 лет назад +48

    😎 Thanks for sharing and helping us to understand this beautiful language.

  • @hayleyha9433
    @hayleyha9433 5 лет назад +4

    great tutorial series. Thank you so much!! I has been learning programming for more than 1 year, I thought I knew Javascript but now I know I don't

    • @Techsithtube
      @Techsithtube  5 лет назад +2

      Phuong, javaScript is a maze, I learn new things in js every day. :)

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

    Thank you brother now i learn how to clean my table, awesome tutorial :)

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

    you are best
    and your Mock interview series was great

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

    First time I see your vids, dropped a like 6 seconds in, tried to relike it 1 minute in... Your explanation is phenomenal

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

    with a number of examples, you have cleared it very nicely. thanks, love, and support.❤

  • @nizamuddinshaikh3185
    @nizamuddinshaikh3185 5 лет назад +2

    For the first time, I came to know that so much goes in for 'this'! That's wonderful. Thanks for sharing.

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

    thank you for explaning "this" using various use cases ! now "this" is awsm !!!!

  • @amundsenq1835
    @amundsenq1835 6 лет назад +1

    Nice clip. May I suggest a few topics I'd like to learn from you?
    1. How do I know manipulating dom via javaScript is expensive? Any statistics in dev tools we can find?
    2. Manipulating window's location api to change url and dom elements without refreshing browser. Like react router can do.
    3. Can you explain how to avoid memory leak in browser? Like duplicating global event listener .
    4. What's lifecycle flow in pure javaScript or browser render flow?
    Thanks.

  • @luqmannbr
    @luqmannbr 5 лет назад +4

    i love javascript after learning from you @techsith

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

    ok this is a really good channel, thank you man you are a great professor

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

    VERY NICELY EXPLAINED TECHSMITH KEEP UP THE GOOD WORK

  • @aydns7
    @aydns7 6 лет назад +30

    great teacher

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

    Nice.This is the best explanation I saw using the analogy object as ‘home’. Very well explained!

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

    LOL I like the interruptions of emphasis, sounds like I leveled up on a video game, "tah dah dah dah"

  • @chingizshidenov547
    @chingizshidenov547 6 лет назад +5

    The best explanation ever

  • @alexbaklanov3685
    @alexbaklanov3685 5 лет назад +4

    This house allegory is indeed brilliant!

  • @christophm.
    @christophm. 5 лет назад +1

    Very nice and approachable explanation!

  • @adistef
    @adistef 6 лет назад +2

    In JavaScript, functions are first-class objects, because they can have properties and methods just like any other object.

    • @Techsithtube
      @Techsithtube  6 лет назад

      yes but it doesnt have this . unless your function is used with 'new' keyword.

  • @manibuilders
    @manibuilders 6 лет назад +1

    superb video. It cleared all my doubts on 'this' keyword

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

    I like your teaching style!

  • @j.almadhaji
    @j.almadhaji 6 лет назад +1

    the best video from the best teacher..God bless you

  • @sherinkonline
    @sherinkonline 5 лет назад +1

    You are simply awsome, the way you represent things is easy to understand.
    Keep going
    All the best

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

    Thank you. The best explanation out there.

  • @adnantariq3346
    @adnantariq3346 5 лет назад +3

    which this is a good example of the "this" keyword, I think it's a better sample of the .call and it's abilities.

  • @Alex-zp6oi
    @Alex-zp6oi 3 года назад

    You are just awesome. khub saras explain karyu tame.

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

    Excellent! thanks for all the help!

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

    thank you for your neat and clean explanation

  • @johnywalkie
    @johnywalkie 6 лет назад +2

    Constructive comment: I agree with @adi stef that functions are actually objects. That's why statement at @7:36 is not correct. As a result THIS inside function refers to itself. Anyways, I like your work and i've learned a lot from you so thanks and keep the good work! :)

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

    you are a " GOD of 'this' " 🔥🔥🔥

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

    Thank you Techsith. I have subbed. I am grateful.

  • @bilgeturkkan6095
    @bilgeturkkan6095 6 лет назад

    You are amazing, greeting from Turkey!

  • @VinothKumar5403
    @VinothKumar5403 6 лет назад +18

    Liked before watching..

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

    holy crap this was a super helpful vid. thanks man

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

    Great explanation with real world example. Thank you!

  • @prakharmittal6295
    @prakharmittal6295 6 лет назад

    Sir your explanation was good but I felt that you carry forward everything very fast. By this, I meant that like after applying a technique, discuss it again for a better explanation. I know some people will say that pause the video or watch it again but I think it would be more clear if you discuss it again or go through the last used technique again.

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

    Hi, your video really help me, great explanation. I translated this video to latin spanish, hope it help others. Thanks.

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

    very clear explanation using simple scenarios. thanks!

  • @spacewad8745
    @spacewad8745 6 лет назад +19

    I am in love with javascript.

    • @Colstonewall
      @Colstonewall 6 лет назад +4

      I'm not. Try Python, then come back and tell me that, lol.

    • @MrC0MPUT3R
      @MrC0MPUT3R 5 лет назад +3

      Try TypeScript

    • @iaml2909
      @iaml2909 5 лет назад

      @@Colstonewall nahh
      C is much much bettler.

    • @DiogoSantos-ln1nz
      @DiogoSantos-ln1nz 4 года назад

      @@Colstonewall Any particular reason why you're learning both? Like Front End and Back End?

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

      @@DiogoSantos-ln1nz Well, they go together. It's kind of hard to make a REST API if you don't make a back end too.
      The backend stuff isn't very hard. At least in my experience, using Express is very simple and can be learned quickly.
      Plus, most of the people I learned from, would make a backend in their tutorials along with the frontend.
      Those like Brad Traversy, CodingTheSmartWay, Academind etc, all made the backend when teaching.
      You kind of had to at that point in time. There weren't these REST API's that are all ready to go services like they have now.
      Hopefully I explained this well, but if you don't understand my ramblings, let me know and I'll try to answer better.
      And, if you need ANY, any help with anything, let me know and I'll help you if I can. If you want my email address, let me know.

  • @adamcrap
    @adamcrap 6 лет назад

    Great analogy between the this keyword and a house!!

    • @Techsithtube
      @Techsithtube  6 лет назад

      Adam, I believe that analogy that involves real life scenarios somehow helps us understand concepts. Thanks for watching!

  • @Katharthik
    @Katharthik 5 лет назад

    Thank you techsith. You just earned my patronage! Keep it up brother

    • @Techsithtube
      @Techsithtube  5 лет назад

      Thanks Karthik . Keep on learning brother!

  • @mikerodrigues3530
    @mikerodrigues3530 5 лет назад +1

    Its explained in such a easy manner ... thanks

  • @sweat_gamer5540
    @sweat_gamer5540 6 лет назад

    The explanation is super and make the concept very clear. Just one issue with the music with header which comes before each scenario. It breaks the understanding flow and connectivity.

    • @Techsithtube
      @Techsithtube  6 лет назад

      GOod point. I will consider correcting it for the next video.

  • @triumphmantra968
    @triumphmantra968 5 лет назад +1

    you saved my day bro...

    • @Techsithtube
      @Techsithtube  5 лет назад

      I am glad that you got it Rohit. Keep on learning!

  • @kartikisahu4938
    @kartikisahu4938 5 лет назад +3

    Thanks, Techsith for "this" tutorial :)

  • @HukMarta
    @HukMarta 6 лет назад +2

    Thanks so mush for such a comprehensive explanation!)
    Must say your work is really significant. I've been watching your channel for a couple of months and I've already learned a lot.
    Also, your tutorials are very helpful for preparing for interviews!) I've already recommended 'Techsith' to all my developer friends))
    Great job, keep going ;)

    • @Techsithtube
      @Techsithtube  6 лет назад

      Thank for recommending my channel to your friends :)

  • @niranjanpoddar3203
    @niranjanpoddar3203 6 лет назад

    Thanks for responding on my mail.
    Your tutorial is really helping me for understanding the concepts.

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

    I'm learning quite a lot, thanks!

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

    This helps me a lot Thanks!

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

    Great lessons, crystal clear explanation. thank you

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

    Your videos are amazing 👌

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

    Awesome clarity in your videos man, great stuff!

  • @mela7611
    @mela7611 5 лет назад +4

    i love the harry potter type music in between the topics

  • @ktran031
    @ktran031 6 лет назад

    Oh the great techsith has made another amazing video!

  • @saikiranrudra1283
    @saikiranrudra1283 6 лет назад

    you explain concepts really well

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

    Amazing approach and fantastic explanation !!

  • @qianbang_
    @qianbang_ 6 лет назад

    Liked after the analogy with the house

  • @alex-dk2rj
    @alex-dk2rj 6 лет назад

    Yo you just saved me after hours of struggling with this! Great teaching.

  • @tejeswarsahu2498
    @tejeswarsahu2498 6 лет назад

    Thank you for your nice explanation on "this" keyword.The beauty of this video is you demonstrated the effect of 'this' in all possible different places at one place.Could you please point me to the starting js video(video 1,video 2,video 3....) so that I can watch one after other serially.Because If I am seeing your videos from here and there, there are something in each video which I do not understand.For example when I was watching this video,I was not clear about let,const.I hope you got me.

    • @Techsithtube
      @Techsithtube  6 лет назад

      Hi Tejeswar, I have created a playlist of js fundamentals from beginning. ruclips.net/p/PL7pEw9n3GkoVYU-ZKBrDnxIiiUn0YP-uO

    • @tejeswarsahu2498
      @tejeswarsahu2498 6 лет назад

      Thank you very much...

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

    Great explanation!

  • @anilpatel08
    @anilpatel08 6 лет назад

    Awesome Tutorial (Your Examples Gives Clear Interpretation of Understanding Concept)
    Thanks for making this video...😊

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

    This explanation was great but an instance where the function is passed as a parameter -- the method separates from the object and 'this' would refer to the global object.
    Ex: setTimeout(myObj.myMethodUsingThis, 1000)
    'this' inside that method is now the window obj.

  • @arunkaiser
    @arunkaiser 5 лет назад

    Fantastic no words dude

  • @srinumajji501
    @srinumajji501 6 лет назад

    nice tutorial, Every thing is cleared with 'this'
    thanks Sir

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

    Thank you for putting time and efforts to make this video. God bless you for that.
    Those sound brakes though I find them distracting and annoying.

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

    your lecture helps me a lot to figure out :D thanks so muchchchhc :D

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

    Man, this is really good video, it cleared so many things for me! Thank you for that!

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

    How can we call inner function directly?
    I am not getting any output in VS CODE when I am trying this inside a function

  • @limitless9483
    @limitless9483 5 лет назад +1

    very good teacher thanks( subbed &liked )

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

    Thanks my friend! Awesome!!!

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

    Nice explanation. I just have one doubt here. At 7:36 at this point of time, You said 'function is not an object' but everywhere I have read in javascript, everything is object and indeed function is also an object in JavaScript. So can anyone here clarify my doubt regarding this point ? Thank you!!

  • @motorings735
    @motorings735 6 лет назад +1

    This was incredibly helpful! Thank you.

  • @Roger-ub3wp
    @Roger-ub3wp 6 лет назад

    Thanks a lot, a very clear illustration of this concept.

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

    this cleared up so much for me. thanks!

  • @alex-front-end
    @alex-front-end 6 лет назад +1

    Awesome manner of explanation! Cool channel. Don't stop, thank you!

  • @buncha1499
    @buncha1499 6 лет назад +2

    Much love techsith!

    • @Techsithtube
      @Techsithtube  6 лет назад +1

      Thanks for watching!

    • @buncha1499
      @buncha1499 6 лет назад

      techsith And thank you for making! I've learned lots from you and am very grateful, keep it up!

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

    great tutorial, thanks!

  • @hemantgajbe8366
    @hemantgajbe8366 5 лет назад

    Good explanation about 'this' , giving a example really help us to understand and use in real world scenario, could you please give some real world example like how to use in app like banking, or hotel booking etc.. so that it will be more useful. Same examples for complicated topics like promises and closures. Thanks Sir for sharing knowledge with us :)

  • @majia
    @majia 6 лет назад

    Best explanation ever for this. Thank you so much!

  • @kubataiupov1245
    @kubataiupov1245 6 месяцев назад

    Nice tutorial!!!!

  • @shauryaverma8780
    @shauryaverma8780 6 лет назад

    Sir ,
    At 17:46 , you mentioned every object that cleanRoom creates, you'll have that method automatically available to it.' Please explain this part. It is cleanTable or createRoom. Where this method gets added??

    • @Techsithtube
      @Techsithtube  6 лет назад +1

      Shaurya, first of all you have to have a constructor function . which has ability to create objects. more like a class. Now instead of adding method directly to it . you can a method to its prototype. so when you create object from this constructor function all the object will have a access to these methods via some reference. Here is a playlist that will help you explain all of these. ruclips.net/p/PL7pEw9n3GkoW0ceMeoycg9D00YjPAbtvt

    • @shauryaverma8780
      @shauryaverma8780 6 лет назад

      Thank you sir.

  • @budheshwartiwari599
    @budheshwartiwari599 6 лет назад +1

    Thanks you so much techsit tutorial