What is THIS keyword in JavaScript? - Tutorial for beginners
Vložit
- čas přidán 25. 06. 2024
- What is the THIS keyword in JavaScript? How does it work and why is it so confusing?
The THIS keyword, from the series "10 Things JS Developers Should Know"
by ColorCode.io, Sina Jazayeri
Full playlist here: • 20 Things JavaScript D...
This is episode 6 in a 10 part series I’m calling 10 things javascript developers should know but probably don’t. In this series, we’re going to cover some of the most fundamental and important parts of JavaScript that most of us don’t actually know, and barely touch. Today, for episode 6, we’re talking about the THIS keyword, how context and execution logic changes the value of the this keyword, and how arrow functions affect the value? Episode 6: The THIS keyword. Let’s go!
All the code from this series is available here:
github.com/ColorCode/js-10-th...
0:00:00 Intro
0:00:53 THIS in Global scope
0:01:40 THIS inside functions (methods)
0:06:25 Function.bind
0:10:03 Function.call
0:16:10 Function.apply
0:16:42 THIS inside Constructor functions
0:20:00 THIS inside callback functions
0:23:40 THIS inside arrow functions
0:24:26 Conclusion
JavaScript THIS keyword explained - A deep dive 👨🏻💻
So I have a very important question. PLEASE help. So there must be more to the layers of seniority I should say to the concept of front vs backend…there’s more job titled for a coder of all levels. What are those many titles called?
Web developer
Front end
Back end
Web designer
Programmer (which idk if that’s just another word for web dev or if that’s a proper title)
Junior developer (idk if that’s another word for entry front end)
What other titles are there? Knowing this would help people find a proper path to get started instead of aiming high like “I want to be a software developer” like I did 3yrs ago. Now I’m aiming for front end (if that’s right) and design web logic to interact with smart contracts (I want to work in the blockchain industry and a lot of the work is programming websites to interact with the contracts)
Thank you
@@arod3295
There are many job titles and roles within the world of software development. Here are some common ones:
Full-stack developer: a developer who can work on both the front-end and back-end of an application.
Mobile developer: a developer who specializes in building applications for mobile devices.
Game developer: a developer who specializes in building video games.
DevOps engineer: a developer who works on the development and deployment of software through collaboration with software developers and IT professionals.
Software engineer: a developer who designs, builds, and tests software applications.
QA engineer: a developer who is responsible for testing software applications to ensure that they function properly.
UX/UI designer: a designer who specializes in creating user interfaces and experiences for software applications.
Product manager: a professional who oversees the development and management of a software product.
Technical writer: a professional who creates documentation and user guides for software applications.
It's important to note that some of these roles may require more specialized knowledge or experience in a particular area. For example, becoming a mobile developer may require knowledge of specific programming languages and frameworks, as well as experience with mobile app development.
Ultimately, the best way to determine which role is right for you is to explore the different areas of software development and see which ones interest you the most. Consider taking online courses or tutorials, attending meetups or conferences, and talking to professionals in the field to learn more about the different roles and how you can get started in your desired career path.
Dear CZcams's Algorithm gods, please bless this channel with a million views per episode 🙏🏼😁. This content is absolutely gold. I've been learning JS for the past 2 months and I'm really benefitting from all this knowledge. Thank you so much, and keep up the fantastic work! Cheers from Brazil!
Haha this is the best comment I ever got. Thank you. I'm glad these videos are helping. Message me on instagram if you have questions.
@@ColorCodeio You 100% deserve it!
Amen!
Your wish granted😁😅😅
This is an underrated channel! The explanation is mind blowing not confusing at all, please keep making videos on JS 🙏
Great to hear that! More videos coming soon.
@@ColorCodeio lol i really like this thank you lolllll xddddd
'This' video should have at least 100 times more views. Pure gold if you've ever been confused about the intricate applications of 'this' in different contexts. He also covers .bind, .call, .apply as a nice bonus. My favorite video about 'this', simple as 'that'!
Thank you for 'that'! ;)
I watched your video on THIS...didn't understand anything......then i watched 10 other random videos on CZcams about THIS....did not understand anything. I gave up and went on with my day. The next day your 1 min video on THIS popped up, i watched that, and that was clear as day!!!! I followed up by watching this 24 min video, and everything was so clear!! I don't know if its just the time it took for information to absorb over 24 hours or i re-watched your videos a few times like you said at the end, in order to get it. One thing is for sure, this is the best tutorial on THIS and i am pretty sure i watched them all. Love your teaching style, very good examples and slight humor sprinkled around. Subscribed!
That's awesome! Thanks for sharing and I'm glad it clicked.
Style, pace, music, explanation, effects, even typing sound... everything is perfect.
Thank you :)
Always liked creating and designing. Programming is a new journey that I’m taking (haven’t had really good inexpensive sources to learn from)and I’m super glad I found you and I know your videos and courses will guide me finally the right way
Great to hear! Best of luck in your journey and reach out to me if you have questions.
The most underrated educator on YT. Production quality is also insane. Keep it up man!
I appreciate that!
came here looking for explanation on the original f***ing a**hole of JavaScript, aka the this keyword. Ended up watching the entire series.
Thank you
haha nice
Excellent explanations on subjects have always been a mystery to me. Thank you for making these tutorials, really insightful and entertaining.. dig your teaching
style. Keep them coming!
I appreciate that. Thank you 👍
Love these videos! You explain concepts really well and in great detail.
👍👍👍
i watched a single video of yours and fell in love with your way of teaching, the background music, the humor everything loved it ..! subscribed
Awesome dude 👍🏼
Simple, clear and perfect for beginners explanation of 'this' keyword, thanks, man!
You're very welcome!
This channel is the best when it comes to JS. Honestly it needs more views. Thanks Sina, keep up the fantastic work.
Thank you!
this playlist need to be everywhere !
Thank you Sina!
🙏
Best "this" tutorial I found. Thanks
This was so well explained with good examples. I probably need to rewatch it to remember everything but I understood it all.
👍
Please keep going with your videos.
You are really easy to understand and fun to watch.
Thanks :)
This channel and Web Dev Simplified are the most helpful channels for Web Developers. Thank you!
Thanks!
These videos are helping me to fill the knowledge gaps I have
Loved the video explanation. I was following a JS course for a month and this one dominates all
Great to hear!
Content is just amazing I could'nt stop watching
I'm glad :)
this is better than 99% of the blog posts out there trying to explain core concepts like this!
🙏🏼
What a great job, you're doing!
this is amazing! thank you so much for this deep dive!
best explanation of "this" I have found and I was looking in 3 different languages on YT
Glad to hear it!
Amazing video, clear explanation, great communication and presentation skills, and covers all the ins and outs without making it overly complex.
Thank you!
You deserve so many more views and subs! This content is gold
Thank you :)
gold mine which isn't known by many .. love this channel
i was confused in this from aproximately 1yr i was just asuming it not understanding it true meaninig. thanks to you i was completely able to understand the topic this, (same concept self in python)
Glad it helped!
dude you are so real and good at explaining. this has helped a lot
Thank you!
Thank you so much! Beautifully explained. Keep posting
Thank you, Aman :) More coming next week.
Really thanks for all the effort, it's really fun to watch and learn from you, you convey it in a pleasant way and not like a robot or excessive seriousness, just a pleasure.
Thank you! ♥️
Nicely explained! thanks for the amazing quality of your videos. Took a bunch of notes to review after watching the video.
Just found your channel, you would be a blast to work with! I would be dying all day with your humor
Who knows, maybe some day :)
Best explanation! I swear to god, this is amazing
Dude, I really love the way of teach things, Really Awesome !! The hat's off to you.
Thank you!
This is really good! I'm very grateful!
Thanks :)
Your explanation and presentation of the video are so good that I couldn't even wait to share this to my fellow learners and also SUBSCRIBED. Really, you should have got more views and subscribers. Keep up the good work 😀😎🙏
Great production and all, thanks for sharing. +1 for providing purposeful and real-world use-case cases to provide the context for your teaching. My brain is constantly trying to work out the end goal and why what you're teaching has value, making it difficult to follow along.
Much appreciated!
Our WDD 330 Fundamentals of Web Development class at Brigham Young University - Idaho has this video as part of our notes! I like how you explained all of "this" ;) I enjoyed your video start and your energy throughout the video. I got lost on that last part where you set a time-out but I felt like I understand how to use "this" better than I did before. I need to watch your arrow function video. That's one thing that I get tripped up with. Thanks for all the time and work you put into making this video. Liked and subscribed!
You are just awesome explainer/teacher! Keep going my friend!
Thank ya
man, i love your videos ! they are incredibly informative and also funny to watch !
Thank you!
Thank you! So helpful
love you man great work.
Very good and very high quality video. Thank you. Learned a lot👍🏻
Awesome. You’re welcome 👍
Amazing explanation. Keep it up, sir!
Thanks!
The best explanation of This 😍
Amazing tutorial man.
Appreciate it!
i really liked it when i can see the person who is teaching ,great work
Thank you
perfect, everything is perfect....
The concept , the video, editing , making us attracted, every thing is perfect
expecting more video from you (react if possible)
Cool explanation. BTW, the video quality is great, and the speed of the talk is good, like the clear accent.
👍
I dont know how this type of content can only have 25k views
As an italian brother, your italian is perfect! And also your Javascript! XD
Grazie mille
keep rocking saanaaaaaaaa ... waiting for more 🔥
More coming end of July
Great editing.
👍🎥🎞
Thank you for the video, very well explained! 💥
♥️
So good, help me a lot!!
Glad to hear that!
this is such a great video, thanks!
Thank you!
Hey, your content really adds value to my skillset. Please do make more videos. Love from India ❤
Thank you very much man. I had to watch it a couple of times, but I finally got the whole *this* concept. Also, you sound 100% like Edward Snowden.
Glad to hear it!
Man i stubbled on your content, love it!!!! Greetings from Switzerland
Awesome. Thank you. One of my favorite places 🇨🇭
@@ColorCodeio Ma man!
love your content and attitude! am here just to say thanks!
Awesome! Thank you!
You are great man!!!!!!!... Very well explained....
Thanks
Glad it helped
Thank you very much:) love your sense of humor;)
You are so welcome!
good stuff. thanks
Yep, super helpful!
👍
Your expectations are great 👍 Thanks
Thank you!
Is bind only used with the keyword 'this'? This is a great explanation, but I had to pause and rewind several times to grasp the concept more fully. Actually, to clarify, this is the BEST explanation I've come across, and I have been searching for the correct way to use 'this' for quite some time!
So cool!
You're a Legend
great effort
This is awesome, thanks :)
You're welcome
best instructor which u cannot even get on paid course, after watching this i became his big FAN!!😊
Thanks dude
love this channel
'This' is too good. I'll never choose that
instant subscribe, this channel is really emazing
Thank you
Amazing channel!
Thank you!
.this is awesome and THIS is awesome. Thank you so much!!
You’re awesome :)
Great explanation! By the way, what actually is the favorite feature mentioned in 2:54 ?
Love these videos, but could you also share some real world use cases? Like for call, apply,bind etc. Even for this, why do we really need it
The channel needs more support !
🙏
Thanks a lot. after a lot of exhausting search, i realized this keyword.
Awesome. I'm glad!
I love how you interact even though I am not still cool with it yet. But thanks
👍
Great content!
Thanks
2nd best channel after ColorCode. Oh wait this is ColorCode
haha thanks!
Awesome i love this course ❤ . Also make a tutorial on React
I really like your classes. I'm using them in conjunction with a UDemy course and learning it from a couple folks is helping it sink in a bit more. I hope you do one on the Reduce method.
Awesome. I may do one in August
@@ColorCodeio would also love one on reduce!
Nice video. Help me to solve my confusion about the meaning of this in JSX callbacks.
Nice!
I'm amazed that THIS can be explained without causing a headache. Hit the subscribe button. Thank you so much :)
Glad it helped!
you look like tony stark and i find it amazing
🔥🙏
Thank you for your amazing videos. Please consider dropping the use of the non-standard innerText in favor of the standard textContent as many of your less experienced viewers will pick up that otherwise. innerText has its place (preserving linebreaks and whitespace), but in your examples its really all about textContent.
Thanks for the comment. You obviously pay close attention to detail :)
your videos are amazing , you give tricky tips when you code , in a smpile ways , please make it 100 things you might don't knoOoOoOow in JS
👍🙏
Thank You!!! Greetings from Germany, Berlin!
Hello Germany 🇩🇪
Amazing !!
👍
You will definitely go to heaven bro💯
Subscribed! because you said " i am qoli" amazingly 😀 and of course such a good video!
Haha awesome #Qoli
آقا دمت گرم عالی بود ❤
Thanks!
Thank you so much
Looking forward to the arrow function gotchas
Oh it's comin'!