JavaScript Tutorial For Beginners #29 – THIS Keyword




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

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

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

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

Original source


26 responses to “JavaScript Tutorial For Beginners #29 – THIS Keyword”

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

  2. 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".

  3. 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 🙂

  4. Im pretty new to coding and programming but i think its awesome but i didnt quite get the THIS keyword, like what is THIS, is it inside the 1st opening bracket to the 1st ending bracket if u put it inside those brackets?

  5. DUDE, you have a gift.. of teaching, I hae been trying to understand the concept of 'this' for days now, and I watch your 5 MIN video and i GOT IT. This is why I love youtube, I am thankful for videos like this and person like you 🙂

Leave a Reply