Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; COUNT_CLASS has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/functions.php on line 1713

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; sidebar_generator has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/plugins/multiple_sidebars.php on line 29

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_video_widgets has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/video.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_soundcloud has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/soundcloud.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_counter_widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/social-counter.php on line 9

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_news_in_pic has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/new-in-pic.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Flickr_Widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/flickr.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_fb_likebox has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/fb.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_google_follow has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/google-follow.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_popular has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/popular-posts.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_recent_posts has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/recent-posts.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_cate_posts has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/category-posts.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tabs_widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/tabs.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_youtube_widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/youtube-subscribe.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_social_links has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/social-links.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_comments_widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/comments.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_author_bio has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/bio-author.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_login has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/login.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_search_widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/search.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Ad_120_600_Widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/ads120.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Ad_125_125_Widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/ads125.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Ad_250_250_Widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/ads250.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Ad_300_300_Widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/ads300.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_tweets_load has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/twittes.php on line 10

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; feedburner_widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/newsletter.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_related has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/related.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_slider has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/slider.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_top_rate has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/top-review.php on line 6
JavaScript this Keyword | D4mations.com
  • Thursday , 25 April 2019

JavaScript this Keyword

Code Canyon



JavaScript this Keyword

🔥Get the COMPLETE course (83% OFF – LIMITED TIME ONLY): http://bit.ly/2M1sp4B

Subscribe for more videos:
https://www.youtube.com/channel/UCWv7vMbMWH4-V0ZXdmDpPBA?sub_confirmation=1

Want to learn more from me? Check out my blog and courses:

http://programmingwithmosh.com
https://www.facebook.com/programmingwithmosh/


Original source

3d Ocean

Related Posts

37 Comments

  1. TorentLife
    March 18, 2019 at 15:58

    Thanks. Watch it using 0.75x pace and Thank me later

  2. Станислав Хаджиев
    March 18, 2019 at 15:58

    Thank u a lot Mosh. That was a very clear and good explanation. Helped me a lot with something that was quite unclear to me up to this point 🙂

  3. Joey Schmitz
    March 18, 2019 at 15:58

    Awesome explanation. Thanks!

  4. Gerald Darko Bekoe
    March 18, 2019 at 15:58

    Thank you a bunch
    It helped me a lot

  5. Matthieu Martin
    March 18, 2019 at 15:58

    You are a very good teacher. now i understand the basics of this thanks to you. I love your Javascript videos I've learned a lot of things thanks to you. Thanks a lot for sharing your knowledges.

  6. Aarmaxian
    March 18, 2019 at 15:58

    Thanks. A very easy to understand and abundantly clear video.

  7. Daniel
    March 18, 2019 at 15:58

    Very nice Mosh. Now why there are dozens of complicated articles that doesnt make sense? I read today abou five long articles about call(), apply(), bind() and this but was more and more confused. They maybe get it right but teach it wrong … in this short video I had two big insights – it clicked all together. Thx.

  8. Eric P
    March 18, 2019 at 15:58

    >criticizes others for their teaching methods
    >blazes pass the material at the speed of light
    🙄

  9. Patricio Serrano
    March 18, 2019 at 15:58

    My saviour!

  10. Maly Mandaro
    March 18, 2019 at 15:58

    I am getting brain fuck from "this"

  11. Ratan Khalsa
    March 18, 2019 at 15:58

    Urgent Question: I am fairly comfortable with JavaScript. I know ES6 basics as well useful for React developers.
    I have an interview in 4-5 days and wanna know should I invest my time in Mosh's JavaScript YouTube video or the course?
    Is it beneficial for a JavaScript focussed interview with tech giants here in the US?

  12. Pankaj Yadav
    March 18, 2019 at 15:58

    awesome explanation .. Thanks

  13. wahdat kashmiri
    March 18, 2019 at 15:58

    Great

  14. TatTvamAsi
    March 18, 2019 at 15:58

    Honestly, this makes so much sense to me. When people were telling me the 'this' in JavaScript is complicated I was worried that I would struggle to learn it but it makes so much sense if you stick to the rules for methods, functions, and constructor functions.

  15. menny xc
    March 18, 2019 at 15:58

    At first i didn't understand this, then my brain got fucked by the explanation but afterwards i understood, as an overall it was an incredible explanation you just got a let it sink.

  16. darkandgreen
    March 18, 2019 at 15:58

    Damet garm!

  17. Harshit Khanna
    March 18, 2019 at 15:58

    That was a good short explanation. Thanks Mosh.

  18. Gabriel Lidenor
    March 18, 2019 at 15:58

    You can also do like this:

    const video = {
    title: 'a',
    tags: ['a','b','c'],
    showTags(){
    this.tags.forEach((tag) => {
    console.log(this.title, tag);
    });
    }
    };

    video.showTags();

    the => does not create a "this" context, it gets the "this" context from the enclosing scope, which in this case, is the video object itself. Nice lesson, I learned a lot.

  19. Mohd Faisal
    March 18, 2019 at 15:58

    Great explanation! Thanks.

  20. Shota Tamura
    March 18, 2019 at 15:58

    Most clear explanation ever! thanks

  21. Ahmed Alaa
    March 18, 2019 at 15:58

    Super simple. Many Thanks 🙂

  22. Hosein Haghayeghi
    March 18, 2019 at 15:58

    Awesome Explanation ! Finally I got "This" !

  23. Varun Kenadath
    March 18, 2019 at 15:58

    i have a doubt though in 2:01 Mosh says that stop is a method in the video object but isn't it actually outside the video obje t

  24. Yee Li
    March 18, 2019 at 15:58

    This is complicated

  25. Rogério Oliveira Batista
    March 18, 2019 at 15:58

    Simple and useful! Thanks for your classes 😀

  26. Brandon Dorsey
    March 18, 2019 at 15:58

    Is there any specific reason why you don't us name-value pair for the method play?

  27. Video Reklamos
    March 18, 2019 at 15:58

    nice!

  28. Atlas Maxima
    March 18, 2019 at 15:58

    Wow, I watched only the first minute and it makes so much sense now than trying to read articles about it!

  29. Alex Lacayo
    March 18, 2019 at 15:58

    Great explanation!

  30. Alex Lacayo
    March 18, 2019 at 15:58

    Link to the next video?

  31. Bilel Jribi
    March 18, 2019 at 15:58

    I rarely make comments on YouTube, I just want say THANK YOU, this is by far the best explanation for the "this" keyword I have found!

  32. Subrat Kumar Mohanty
    March 18, 2019 at 15:58

    At 3:08 in constructor function we are neither calling the object nor the constant V …so how we are getting that object in console ?? i am kinda confused …pls elaborate sir…

  33. Ailan Jin
    March 18, 2019 at 15:58

    great explanation, and by the way, can I know what IDE are you using?

  34. Wen Jie Sing
    March 18, 2019 at 15:58

    best explanation ever!!

  35. pouvoir Cerveau
    March 18, 2019 at 15:58

    ,you have such a bieautiful explanation man ,please keep it up

  36. Kaiwen Sun
    March 18, 2019 at 15:58

    tl;dr:
    case 1:
    `this` in an object method — referencing the object.
    case 2:
    `this` in a regular function — referencing `window` (`global` in node.js)

    case 3 – a special case inferred from case 1:
    function Video() {console.log(this);}
    new Video;
    referencing a new `Video` object, because `new` creates an empty object `{ }` and `Video` serves as a constructor method of the object.
    case 4 – a special case inferred from case 2:
    `this` in a regular function in an obj method — referencing `window` because `this` is in a regular function.

    case 1 at 1:00
    case 2 at 2:13
    case 3 at 2:33
    case 4 at 4:35

    Note: all the four cases above are based on the assumption that nothing is tampered with by things like `call`, `apply` and `bind`.

  37. No name ok
    March 18, 2019 at 15:58

    Nice, you did an excellent job here, congrats!
    I was lucky I learned OOP basics during a college course, most of the teaching material available for self learning is confusing.

Leave A Comment

You must be logged in to post a comment.