SHARE

Hey all, in this JavaScript tutorial for beginners, I want to introduce you to the THIS keyword, so… Ninjas, meet the THIS keyword. THIS, meet the ninjas :). Anyway, THIS in JavaScript is a very useful tool, and refers to whatever object currently owns the context you are working in.

For example, at the root of your document, the Window object owns it, so THIS represents the Window object. Therefore, we can call any property on THIS (within the Window context) as we can on the Window object itself.

Any questions, just ask!

SUBSCRIBE TO CHANNEL – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg?sub_confirmation=1

========== JavaScript for Beginners Playlist ==========

https://www.youtube.com/playlist?list=PL4cUxeGkcC9i9Ae2D9Ee1RvylH38dKuET

========== CSS for Beginners Playlist ==========

https://www.youtube.com/playlist?list=PL4cUxeGkcC9gQeDH6xYhmO-db2mhoTSrT

========== HTML for Beginners Playlist ==========

https://www.youtube.com/playlist?list=PL4cUxeGkcC9ibZ2TSBaGGNrgh4ZgYE6Cc

========== The Net Ninja ============

For more front-end development tutorials & to black-belt your coding skills, head over to – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg or http://thenetninja.co.uk

========== Social Links ==========

Twitter – @TheNetNinja – https://twitter.com/thenetninjauk

33 COMMENTS

  1. my goodness, i am learning javascript and it is so damn difficult. my brain hurts when i am learning javascript. however, i have to say that this video is really good at simplifying the "this" keyword and i understand it

  2. First of all, you are truly an amazing teacher. I wanna know why do you put , after the } , because I have never seen that before? So as the }; What is the difference?

  3. I concur with many other commenters here, Shaun. You've done a great job generally with JS and the video here on the "this" keyword is among your very best efforts on our behalf. I truly hope you are finding ways to monetize your channel. You should be rewarded financially, in my estimation, for these wonderfully helpful tutorials.

  4. So basically 'this' depends on 2 factors?
    1. If not within an object, it refers to the window.
    2. If within an object, refers to the object.
    Anything I missed?

  5. Thankyou!!

    seriously, why can't all tutorials be this simple to understand. Sometimes the way it is explained and the examples used are what makes all the difference in understanding such abstract concepts.

  6. I am taking Udacity's Front End Developer Nanodegree and you just explained the "this" keyword better than their 19 part series in 5 minutes, thank you.

  7. Thanks for such a straightforward video. They are rare gems to come by. I have a question though. Doesn't the "this" keyword only work when a method is called and not a regular function? That is what I learned, but it seems like you were able to run a regular function and still use "this".

  8. Thanks a lot for what you've been doing, man. I'm terrible at understanding the academic language used in most books on JS, so your straightforward explanations have been of great help for me.

  9. I have read like five different info sources and nothing. But your 5 min video and I understood everything. It's not just about "this" word. It's about the entire JS course. Big thanks for your hard work and keep doing teaching. Its definitely a calling 🙂

LEAVE A REPLY

Please enter your comment!
Please enter your name here