What is THIS keyword in JavaScript? - Tutorial for beginners

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024

ความคิดเห็น • 287

  • @ColorCodeio
    @ColorCodeio  3 ปีที่แล้ว +48

    JavaScript THIS keyword explained - A deep dive 👨🏻‍💻

    • @arod3295
      @arod3295 3 ปีที่แล้ว +1

      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

    • @starkxz
      @starkxz ปีที่แล้ว

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

  • @darksoulgamer5837
    @darksoulgamer5837 3 ปีที่แล้ว +48

    This is an underrated channel! The explanation is mind blowing not confusing at all, please keep making videos on JS 🙏

    • @ColorCodeio
      @ColorCodeio  3 ปีที่แล้ว +5

      Great to hear that! More videos coming soon.

    • @redeye8536
      @redeye8536 3 หลายเดือนก่อน

      @@ColorCodeio lol i really like this thank you lolllll xddddd

  • @cleanocavalcante
    @cleanocavalcante 3 ปีที่แล้ว +81

    Dear TH-cam'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!

    • @ColorCodeio
      @ColorCodeio  3 ปีที่แล้ว +11

      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.

    • @cleanocavalcante
      @cleanocavalcante 3 ปีที่แล้ว +1

      @@ColorCodeio You 100% deserve it!

    • @omersoncruz1081
      @omersoncruz1081 ปีที่แล้ว

      Amen!

    • @uzgurCoder
      @uzgurCoder ปีที่แล้ว +1

      Your wish granted😁😅😅

  • @neria15
    @neria15 9 หลายเดือนก่อน +1

    this playlist need to be everywhere !
    Thank you Sina!

  • @nnex5
    @nnex5 ปีที่แล้ว +1

    This channel and Web Dev Simplified are the most helpful channels for Web Developers. Thank you!

  • @nynzxoxo
    @nynzxoxo 3 ปีที่แล้ว +3

    You deserve so many more views and subs! This content is gold

  • @stepanterechshenko5435
    @stepanterechshenko5435 ปีที่แล้ว +1

    best explanation of "this" I have found and I was looking in 3 different languages on YT

  • @havefun5519
    @havefun5519 ปีที่แล้ว +1

    Cool explanation. BTW, the video quality is great, and the speed of the talk is good, like the clear accent.

  • @chrismills5307
    @chrismills5307 11 หลายเดือนก่อน +1

    Amazing video, clear explanation, great communication and presentation skills, and covers all the ins and outs without making it overly complex.

    • @ColorCodeio
      @ColorCodeio  9 หลายเดือนก่อน

      Thank you!

  • @asadmoosvi
    @asadmoosvi 3 ปีที่แล้ว +4

    Love these videos! You explain concepts really well and in great detail.

  • @programmingforfun4158
    @programmingforfun4158 ปีที่แล้ว

    I dont know how this type of content can only have 25k views

  • @abhijeetbajpai1022
    @abhijeetbajpai1022 8 หลายเดือนก่อน +1

    Dude, I really love the way of teach things, Really Awesome !! The hat's off to you.

    • @ColorCodeio
      @ColorCodeio  8 หลายเดือนก่อน

      Thank you!

  • @syedaun5410
    @syedaun5410 2 ปีที่แล้ว +1

    Please keep going with your videos.
    You are really easy to understand and fun to watch.

  • @santhoshk9285
    @santhoshk9285 3 ปีที่แล้ว +2

    keep rocking saanaaaaaaaa ... waiting for more 🔥

    • @ColorCodeio
      @ColorCodeio  3 ปีที่แล้ว +1

      More coming end of July

  • @namanjoshi5089
    @namanjoshi5089 ปีที่แล้ว

    gold mine which isn't known by many .. love this channel

  • @YeetYeetYe
    @YeetYeetYe 2 ปีที่แล้ว +2

    Great editing.

  • @kurisu26
    @kurisu26 11 หลายเดือนก่อน

    Best "this" tutorial I found. Thanks

  • @ayushdixit8993
    @ayushdixit8993 ปีที่แล้ว +1

    You are great man!!!!!!!... Very well explained....
    Thanks

  • @ann_uken
    @ann_uken ปีที่แล้ว +1

    Thank you for the video, very well explained! 💥

  • @slaincore
    @slaincore ปีที่แล้ว +1

    You are just awesome explainer/teacher! Keep going my friend!

  • @nathanisong9393
    @nathanisong9393 2 ปีที่แล้ว +1

    I love how you interact even though I am not still cool with it yet. But thanks

  • @oneofone_1333
    @oneofone_1333 2 ปีที่แล้ว +1

    Man i stubbled on your content, love it!!!! Greetings from Switzerland

    • @ColorCodeio
      @ColorCodeio  2 ปีที่แล้ว +1

      Awesome. Thank you. One of my favorite places 🇨🇭

    • @oneofone_1333
      @oneofone_1333 2 ปีที่แล้ว

      @@ColorCodeio Ma man!

  • @KhrystynaKlapushchak
    @KhrystynaKlapushchak ปีที่แล้ว +1

    Thank you very much:) love your sense of humor;)

  • @randyafriansyah9340
    @randyafriansyah9340 2 ปีที่แล้ว +1

    instant subscribe, this channel is really emazing

  • @HosseinBajan
    @HosseinBajan 3 หลายเดือนก่อน +1

    آقا دمت گرم عالی بود ❤

  • @soniablanche5672
    @soniablanche5672 ปีที่แล้ว

    I really wish arrow functions throwed an error if you tried to use the "bind" method on it. It would be a good way to detect if the programmer passed an arrow function instead of regular function as a callback.

  • @bengen12
    @bengen12 ปีที่แล้ว

    you re great Jazayeri , god bless u , are you algerian ?

  • @surmanikonsam3793
    @surmanikonsam3793 7 หลายเดือนก่อน

    does 'this' have to do something with scope chaining?

  • @jimkk159
    @jimkk159 ปีที่แล้ว +1

    So good, help me a lot!!

  • @gatorgrad
    @gatorgrad 11 หลายเดือนก่อน +1

    good stuff. thanks

  • @ProgrammingWithProject
    @ProgrammingWithProject 2 ปีที่แล้ว +1

    Sir please make more videos on javascript

  • @PhantomDeluxe1111
    @PhantomDeluxe1111 4 หลายเดือนก่อน

    Sina please make a video on why we shouldn't use semicolons... Don't include in inside our series make a short video on that it would just takes you like 5 minutes bro please... Your explanations are the best...😎😀😁

  • @boooloool6039
    @boooloool6039 2 ปีที่แล้ว +1

    Subscribed! because you said " i am qoli" amazingly 😀 and of course such a good video!

  • @aballahsameh3597
    @aballahsameh3597 2 ปีที่แล้ว +1

    So cool!

  • @simplesolutions289
    @simplesolutions289 2 ปีที่แล้ว +1

    Does anyone know the editor he is using?

    • @ColorCodeio
      @ColorCodeio  2 ปีที่แล้ว

      Chrome DevTools

    • @simplesolutions289
      @simplesolutions289 2 ปีที่แล้ว +1

      Thank you very much for the answer and the classes!

    • @ColorCodeio
      @ColorCodeio  2 ปีที่แล้ว

      You’re welcome

  • @osamahashim
    @osamahashim 3 ปีที่แล้ว +1

    Great job man, could you please make a chain about promises async await 💙

    • @ColorCodeio
      @ColorCodeio  3 ปีที่แล้ว +2

      Maybe in August 👍

  • @alimansourey2076
    @alimansourey2076 ปีที่แล้ว

    No . This-keyword in javascript is definitely much more complicated than what you said here ... However, your way of teaching is greate .

  • @TheAcidMotion
    @TheAcidMotion 3 ปีที่แล้ว +2

    this.arse; Great video!

  • @coder236
    @coder236 7 หลายเดือนก่อน

    Idk but for some really sound isn't playing on this video but others is fine

  • @mariusmoise3932
    @mariusmoise3932 ปีที่แล้ว

    if you pass at talk function `I am ${this.name}` it doesn't return correct name
    function Person(n) {
    this.name = n;
    this.talk = function () {
    `Hello, I am ${this.name}`;
    };
    }

  • @lewitness1759
    @lewitness1759 2 ปีที่แล้ว +1

    I think watching a second time helps

  • @BcomingHIM
    @BcomingHIM 11 หลายเดือนก่อน

    can you also teach how to be handsome and charismatic as you are🤕

  • @X82oo781
    @X82oo781 8 หลายเดือนก่อน

    Who is qoli

    • @ColorCodeio
      @ColorCodeio  8 หลายเดือนก่อน

      Craig's best friend

    • @X82oo781
      @X82oo781 8 หลายเดือนก่อน

      who is craig@@ColorCodeio

  • @Pareshbpatel
    @Pareshbpatel ปีที่แล้ว

    A great explanation of the 'this' keyword. Thanks
    {2923-06-19}

  • @atlas8133
    @atlas8133 2 ปีที่แล้ว +15

    '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'!

    • @ColorCodeio
      @ColorCodeio  2 ปีที่แล้ว +1

      Thank you for 'that'! ;)

  • @axkongkong2819
    @axkongkong2819 ปีที่แล้ว +5

    I watched your video on THIS...didn't understand anything......then i watched 10 other random videos on TH-cam 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!

    • @ColorCodeio
      @ColorCodeio  ปีที่แล้ว +1

      That's awesome! Thanks for sharing and I'm glad it clicked.

  • @RossieeissoR
    @RossieeissoR 2 ปีที่แล้ว +6

    Style, pace, music, explanation, effects, even typing sound... everything is perfect.

  • @digitalfragrant
    @digitalfragrant 7 หลายเดือนก่อน +4

    The most underrated educator on YT. Production quality is also insane. Keep it up man!

    • @ColorCodeio
      @ColorCodeio  6 หลายเดือนก่อน

      I appreciate that!

  • @rjerez
    @rjerez 3 ปีที่แล้ว +3

    Perhaps they should have named “this” as “context” and reduce confusion.

    • @ColorCodeio
      @ColorCodeio  3 ปีที่แล้ว

      You're absolutely right. THIS could mean anything. You should've been on the committee lol Hope you're doing well dude.

  • @hunin27
    @hunin27 10 หลายเดือนก่อน +2

    you look like tony stark and i find it amazing

    • @ColorCodeio
      @ColorCodeio  9 หลายเดือนก่อน

      🔥🙏

  • @dineshreddy8915
    @dineshreddy8915 ปีที่แล้ว +1

    perfect, everything is perfect....
    The concept , the video, editing , making us attracted, every thing is perfect
    expecting more video from you (react if possible)

  • @Flipping_myFinds
    @Flipping_myFinds 3 ปีที่แล้ว +4

    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

    • @ColorCodeio
      @ColorCodeio  3 ปีที่แล้ว +2

      Great to hear! Best of luck in your journey and reach out to me if you have questions.

  • @deepaks9301
    @deepaks9301 ปีที่แล้ว +1

    How did u focus part of screen what is the software ??

  • @darksoulgamer5837
    @darksoulgamer5837 3 ปีที่แล้ว +2

    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

  • @hustle4902
    @hustle4902 11 หลายเดือนก่อน +1

    You will definitely go to heaven bro💯

  • @RAJVEERBIRADAR360
    @RAJVEERBIRADAR360 4 หลายเดือนก่อน +1

    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)

    • @ColorCodeio
      @ColorCodeio  3 หลายเดือนก่อน

      Glad it helped!

  • @rohithaider
    @rohithaider วันที่ผ่านมา

    I can't tell you how much grateful I am to you for making me understand this confusing 'this' keyword. You are such an amazing mentor. Love from Bangladesh ❤

  • @mohamedmahmoud-nj1uh
    @mohamedmahmoud-nj1uh 8 หลายเดือนก่อน +1

    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

    • @ColorCodeio
      @ColorCodeio  8 หลายเดือนก่อน

      👍🙏

  • @andresfelipeladinoespitia
    @andresfelipeladinoespitia ปีที่แล้ว +1

    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.

  • @Salah-YT
    @Salah-YT 2 ปีที่แล้ว +1

    Hello bro thank u so much for all ur nice videos I Love all ur videos but I work with javascript nearly a year now I'm still struggling so even I cant sort it one simple challenge in the CodeWar website so because I work hard on JS I nearly forgot HTML and CSS so please do some video on CodeWar problem solving so people will love the logic and sorting problem please thank u so much

  • @IlPandax
    @IlPandax 7 หลายเดือนก่อน +1

    As an italian brother, your italian is perfect! And also your Javascript! XD

    • @ColorCodeio
      @ColorCodeio  7 หลายเดือนก่อน +1

      Grazie mille

  • @weiguo2297
    @weiguo2297 ปีที่แล้ว +1

    Nice video. Help me to solve my confusion about the meaning of this in JSX callbacks.

  • @szanka96
    @szanka96 ปีที่แล้ว +2

    I'm amazed that THIS can be explained without causing a headache. Hit the subscribe button. Thank you so much :)

  • @RossieeissoR
    @RossieeissoR 2 ปีที่แล้ว +1

    It took 3 times watching to completely understood the topic. Not at once. With the gap of 1 month.

    • @ColorCodeio
      @ColorCodeio  2 ปีที่แล้ว

      Sometimes it takes a while. I'm glad you stuck to it and didn't give up.

  • @zuberytragez7274
    @zuberytragez7274 2 ปีที่แล้ว +1

    I wonder why and i regret so much where i have delayed to know bro. I from Tz. 🇹🇿

    • @ColorCodeio
      @ColorCodeio  2 ปีที่แล้ว

      Welcome to the channel :)

  • @Professor-eu1ll
    @Professor-eu1ll ปีที่แล้ว +1

    2nd best channel after ColorCode. Oh wait this is ColorCode

  • @taylorwade1537
    @taylorwade1537 2 ปีที่แล้ว +1

    .this is awesome and THIS is awesome. Thank you so much!!

  • @randymartin9040
    @randymartin9040 10 วันที่ผ่านมา

    I love this series, thank you so much for it! I love learning the fringe case type scenarios, and you don't edit out your mistakes which is fantastic. It actually helps a ton because we make the same mistakes while learning and often don't know how to solve it. It leads to a very comprehensive understanding of each concept. I really appreciate it!

  • @mohamedbdraldeen5676
    @mohamedbdraldeen5676 2 ปีที่แล้ว +1

    thank u v much u should have at least 1m sub i get the f* "this" now

  • @ivo_sa
    @ivo_sa 9 หลายเดือนก่อน +2

    man, i love your videos ! they are incredibly informative and also funny to watch !

    • @ColorCodeio
      @ColorCodeio  9 หลายเดือนก่อน

      Thank you!

  • @tetianazhuchenko2182
    @tetianazhuchenko2182 ปีที่แล้ว +1

    Your expectations are great 👍 Thanks

  • @AustinThomasFilms
    @AustinThomasFilms 20 วันที่ผ่านมา

    Subscribed instantly, your channel is amazing

  • @by2313
    @by2313 3 ปีที่แล้ว +3

    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.

    • @ColorCodeio
      @ColorCodeio  3 ปีที่แล้ว +1

      Awesome. I may do one in August

    • @davidmmadden
      @davidmmadden 3 ปีที่แล้ว

      @@ColorCodeio would also love one on reduce!

  • @mapzyt
    @mapzyt ปีที่แล้ว +1

    i'm sad that this channel is still underrated

  • @thiagoneves50
    @thiagoneves50 2 ปีที่แล้ว +2

    This is really good! I'm very grateful!

  • @tonmoykakoti7533
    @tonmoykakoti7533 2 ปีที่แล้ว +1

    sounds very funny the way you say "Qoli"

  • @jaswanthreddybora740
    @jaswanthreddybora740 2 ปีที่แล้ว +1

    Do make a series of JS videos for beginners

    • @ColorCodeio
      @ColorCodeio  2 ปีที่แล้ว

      Yep. Coming this fall. Sign up on ColorCode.io

  • @ebcoutinho
    @ebcoutinho 7 หลายเดือนก่อน +1

    These videos are helping me to fill the knowledge gaps I have

  • @edhead76
    @edhead76 8 หลายเดือนก่อน

    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!

  • @uncoding_with_raj
    @uncoding_with_raj ปีที่แล้ว +1

    Amazing tutorial man.

  • @techbro3085
    @techbro3085 ปีที่แล้ว

    Very nice video on "this" and this man deserve this button called subscribe😃

  • @prince5922
    @prince5922 2 ปีที่แล้ว

    4:15 But I can do this
    "use strict";
    const me = {
    name: "sina",
    talk: talk,
    walk: () => {
    return this;
    },
    };
    console.log(me.walk());
    and even though I am in strict mode "this" will refer to window.

  • @uncleswell
    @uncleswell ปีที่แล้ว

    There is an interesting anomaly with this video.. the sound cuts off right around 0:06.. but only with my earbuds.. skipping or reloading the video at any timestamp past that point does not work.. however, sound works fine without the earbuds..
    Have tried debugging the in all sort of different ways.. cant figure it out..
    very, very weird!

  • @chriskasatka2095
    @chriskasatka2095 2 ปีที่แล้ว +1

    Amazing channel!

  • @Jmaster547
    @Jmaster547 ปีที่แล้ว

    Hey idk if this is a stupid question. but in the example at 5:54, when I use return `I am ${name}` instead of this.name, I still get the same output for you.talk() and me.talk(). Was wondering why this still works.

  • @surf2553
    @surf2553 2 ปีที่แล้ว +1

    Yep, super helpful!

  • @zeenuexe8362
    @zeenuexe8362 2 ปีที่แล้ว +1

    OOOOH, so thats how it works :D

  • @junhuama68
    @junhuama68 ปีที่แล้ว

    Thank you for the video Sina. you said that you would do a video on semicolons. I couldn't find it. Could you please point me towards the right direction please?

  • @sharonh387
    @sharonh387 7 หลายเดือนก่อน +1

    Thanks!

    • @ColorCodeio
      @ColorCodeio  7 หลายเดือนก่อน

      Thank you so much

  • @raziyehjed362
    @raziyehjed362 4 หลายเดือนก่อน

    in the 11th minute, you said this " if( lang === "en" )" is very breakable so what do you perefer to do ?

  • @stephendelacruzone
    @stephendelacruzone ปีที่แล้ว

    Pure fucking gold here!👑✨👌The pin finally drop for me... for #this freakin' confusing keyword. Sheesh!😅

  • @DeepakSharma-ue3pn
    @DeepakSharma-ue3pn 2 หลายเดือนก่อน

    This video is the perfect summarisation of chapter "this all makes sense now"

  • @sudiptasaha8905
    @sudiptasaha8905 ปีที่แล้ว +1

    Hey, your content really adds value to my skillset. Please do make more videos. Love from India ❤

  • @reidwilliamson6477
    @reidwilliamson6477 2 ปีที่แล้ว +1

    subbed!

  • @劉奕德-o2s
    @劉奕德-o2s ปีที่แล้ว

    Great explanation! By the way, what actually is the favorite feature mentioned in 2:54 ?

  • @Micheling1997
    @Micheling1997 ปีที่แล้ว

    I've been given in up to learning programming for years on ends, it isn't as easy as some folks think it is.

  • @rahulmp7109
    @rahulmp7109 28 วันที่ผ่านมา

    Your presentation style is really awso🎉🎉🎉🎉

  • @LowrollerWTF
    @LowrollerWTF 3 หลายเดือนก่อน

    Dude thanks so much for this video as an Italian, I can confirm you you can omit or say °Io° and that is perfectly correct 😁
    BTW off topic question: your videos look amazing are you using AE and Premiere or is there a new kid on the block who allows to do this without all that burden?

    • @ColorCodeio
      @ColorCodeio  2 หลายเดือนก่อน +1

      Grazie! I use Final Cut Pro + Apple Motion

  • @Chris2phaBrown
    @Chris2phaBrown 3 ปีที่แล้ว +2

    Looking forward to the arrow function gotchas

  • @X82oo781
    @X82oo781 8 หลายเดือนก่อน

    love this channel