javaScript call apply and bind

Поделиться
HTML-код
  • Опубликовано: 25 ноя 2024

Комментарии • 745

  • @OhGurov
    @OhGurov 8 лет назад +133

    English isn't my first language, but the way you are explaining - everything is accessebly!
    Thank you! Even reading in native language can't help me understand it so clear.

    • @ДенисКаракчиев-р1ю
      @ДенисКаракчиев-р1ю 7 лет назад +7

      Согласен, у того же Кантора неплохо расписано, но не для новичков.

    • @AuthorReviews
      @AuthorReviews 7 лет назад +9

      Тоже читал Кантора, именно эти методы мне сложно было понять. Сейчас все встало на свои места.

    • @gaganbedi4332
      @gaganbedi4332 Год назад

      his accent sucks, so does his teaching. He has the ability to make even simpler topics complex.

  • @DJLaCarone
    @DJLaCarone 8 лет назад +33

    THE BEST TUTORIAL EVER!!! You should get a nobel prize for this man, Thank you so much!! :D

    • @Techsithtube
      @Techsithtube  8 лет назад +12

      That is best comment i have ever seen :) People like you inspire me to make more videos. Thanks for watching

    • @livehappily2022
      @livehappily2022 4 года назад

      Good comments from us are more than Noble prize.... Genuine one 😃

    • @magnetars8
      @magnetars8 2 года назад

      How can I explain, your explanation, I just want to say oop... 👀

  • @eahofer
    @eahofer 8 лет назад +1

    Agreed, concise. In short:-
    CALL = allows to bind a function to an object passed in at runtime (e.g. functionname.call(object, arguments) where inside of functionname, "this" serves as the pointer to the object) with immediate result
    BIND = alternative to CALL that gives you a function for later use

  • @captainboon2978
    @captainboon2978 3 года назад +1

    Very well explained, and that summary at the end eliminated any remaining questions I would have had. Thank you.

    • @Techsithtube
      @Techsithtube  3 года назад

      Glad it was helpful! Thanks for watching

  • @eddawry
    @eddawry 2 года назад +1

    I have good knowledge in constructor function and oop so It seems easy for me to understand it, but I think your explanation makes it very clear thank u very much for this awesome video.

  • @emilandreasyan2374
    @emilandreasyan2374 5 лет назад +32

    8:10 difference between call and apply: call() is used for function arguments, apply() is used for array values

  • @shamshtabrez6492
    @shamshtabrez6492 3 года назад

    Best videos I have seen on call, apply and bind method. Thanks a lot.

  • @electronrecord
    @electronrecord 8 лет назад +4

    Clear tutorial, it is now clear what apply, call and bind does. Thank you.

  • @millennia
    @millennia 9 лет назад +71

    Great tutorial. Make more, please :)
    "A[pply] for array and C[all] for comma"

    • @Techsithtube
      @Techsithtube  9 лет назад

      +millennia Thanks. I am glad you like it. Check out my new tutorial on Closures in Javascript. :)

    • @ijasnijas
      @ijasnijas 7 лет назад

      Or C for Column :D

    • @sauer.voussoir
      @sauer.voussoir 6 лет назад +1

      B[ind] for Book. ABC

  • @yunchenwang4075
    @yunchenwang4075 7 лет назад +1

    was reading eloquentJS and got stuck on these functions, finally clear now. Thanks so much!

  • @ajaygupta2143
    @ajaygupta2143 7 лет назад +1

    The explanation given by you is very simple and easy to understand.
    Also it makes one to remember the concepts rather than going through big MDN documentations.

  • @gabrielfono844
    @gabrielfono844 3 года назад +1

    it is very well explain
    since I have almost two years in coding
    I think begineer wont be able to understand.
    first . it is important to understand the "this " keyword
    this :reference the object that executing the current function.
    since the addTothis function will be an method of the object , then the this will reference that object.
    I hope begineer could understand it more
    please check out techsit video on 'this ' keyword first.

  • @VinothKumar5403
    @VinothKumar5403 6 лет назад +1

    One of the crystal clear explanation of the concept of call vs bind vs apply.

  • @newmagicfilms
    @newmagicfilms 6 лет назад +1

    Arrows, circles, zooms , love, teacher... these should be your tags and title. I love you man! Explained perfectly!

  • @rajchandak7578
    @rajchandak7578 4 года назад +1

    Awesome way to explain call, apply and bind thanx

  • @syedm952
    @syedm952 9 лет назад

    I was trying to understand call , apply for a while, but today I really was able to understand what is the difference between both of them. I really do appreciate it. Your examples are simple and you summarize everything nicely in a very short video.

  • @robs227
    @robs227 5 лет назад +9

    You can also do: var bound = addToThis.bind(obj, 1, 2) to hard code the arguments.
    Then you can pass the last argument, for example, console.log(bound(3))

    • @sindhu1345
      @sindhu1345 5 лет назад +4

      This would be called function currying

  • @rayprusia4753
    @rayprusia4753 4 года назад +1

    Good explanation of bind, call and apply. Thanks.

  • @technoman19
    @technoman19 4 года назад

    I have watched lots of tutorials but the way you explain everything is really great....thank you...

  • @RaGa_BABA
    @RaGa_BABA 4 года назад +1

    straight to the point explanation.....thankyou so much

  • @marioyeung154
    @marioyeung154 9 лет назад +21

    It's super nice to use diagrams and simple examples (addition of numbers) to demonstrate the concepts. The concept itself, to a beginner, is hard to master. It will be more confusing if sophisticated example is used, but you use a very simple example. Thanks a lot.

  • @miguelgomes9726
    @miguelgomes9726 8 лет назад +24

    Brilliant video, thank you for this!

  • @dexternierva6503
    @dexternierva6503 5 лет назад

    The best tutorial on JavaScript call, apply and bind. Thank you very much sir!

  • @Josephrajp
    @Josephrajp 8 лет назад +5

    Great Tutorial, And you are really a great tutor.
    This is the only video from which I understand (Call, apply & bind), I went through many videos to understand this,
    but you have explained it very well and it was very easy to understand.
    Thank you very much...

  • @jeffreybriceno
    @jeffreybriceno 8 лет назад +3

    Thanks for the great totorial, finally I could understand call, apply and bind.

  • @joehuangathome
    @joehuangathome 8 лет назад

    Very clearly taught in a very simple straightforward example.

  • @FreeHindiAdvice
    @FreeHindiAdvice 4 года назад +1

    પટેલ સર તમે ખૂબ જ સરસ રીતે પ્રોગ્રામિંગ સમજાવો છો... તમારો ખુબ ખુબ આભાર !!

    • @Techsithtube
      @Techsithtube  4 года назад +1

      thanks for the gujarati. maja padi gai vanchhi ne.

  • @VinothKumar5403
    @VinothKumar5403 7 лет назад

    in RUclips lots of tutorial channel is there..but you are the best.simple and powerful examples.thanks a lot.this video made my day..

    • @Techsithtube
      @Techsithtube  7 лет назад +1

      I am glad that its helping you . Thanks for watching! :)

  • @economis411
    @economis411 4 года назад

    it takes 14 years to understand this by your video, thanks god who permit this miracle to me

  • @fatjonrrapaj6834
    @fatjonrrapaj6834 2 года назад

    If this is not clear I don't know what can be more clear, thank you for this crystal clear explanation

    • @Techsithtube
      @Techsithtube  2 года назад +2

      You made my day , thank you for watching

  • @truejohnsolo
    @truejohnsolo 5 лет назад

    Like you, I was getting very confused about what these methods did or how to use them. But as soon as I'm watching your video these things have become much clearer. Superb job man, thank you so much

  • @khoitran5816
    @khoitran5816 7 лет назад +1

    You sir are the sith lord when it comes to teaching. Thank you Thank you!

  • @jerrycoffey
    @jerrycoffey 7 лет назад +1

    I think this was an excellent explanation. I had been looking all over the web to explain call and no on else connected all the parts as well.

  • @michaelmedel2449
    @michaelmedel2449 7 лет назад +1

    Excellent! This has confused me for a while but now I i'm getting it! Thanks!

  • @rishitrivedi442
    @rishitrivedi442 7 лет назад +2

    Nice one. Able to understand differences between Call, Apply and Bind functions.

    • @manirajvenkata9319
      @manirajvenkata9319 7 лет назад

      hi Rishi , i understood the call, apply & bind as various ways of printing output. If one method works well, why the other two ? what is the added advantage of having 3 ways of doing the same thing instead of one way ? Can you please explain ?

  • @dooogyyyu
    @dooogyyyu 7 лет назад +1

    Excellently clear & concise!

  • @mianbilalsadiqpannuhan59
    @mianbilalsadiqpannuhan59 3 года назад

    Thank you for this, it wouldn't be easy without your help. May Allah bless you for your aid. ameen.

  • @christopherortega6257
    @christopherortega6257 6 лет назад

    Very clear. You have the gift I wish every teacher had.

  • @sambasiva6753
    @sambasiva6753 6 лет назад +1

    Great ...away some...suuper explanation with simple and easy example....great ..good

  • @Shetu_Sharma
    @Shetu_Sharma 4 года назад

    i just started commenting what if function have multiple arg........... i just heard you saying the same ...... you really great! sir ;)

    • @Techsithtube
      @Techsithtube  4 года назад

      Thanks Shetu for watching. yes if function have multiple args use call .

  • @Lachezariii
    @Lachezariii 7 лет назад +4

    Amazing tutorials, man! You sir had produced the best Javascript tutorials that exist in all WWW space. Thank you!!!

  • @harithag6037
    @harithag6037 4 года назад +2

    There is no option called ‘love’ so I pressed ‘like’. Thanq so much for this great explanation 💕💕💕

  • @ill-fatedstranger447
    @ill-fatedstranger447 6 лет назад

    First i saw JS mock test part 1. In that part there is a problem which is solve by using this concept. But at that time i wasn't able to get the solution which are you shown. But it's now clear to me.

  • @the_sweet_heaven
    @the_sweet_heaven 5 лет назад +1

    Very good explanation. cleared so many doubts

  • @maxwelllasky4346
    @maxwelllasky4346 9 лет назад +1

    This is one of the most straight forward and easy to understand tutorials on call, apply and bind. Great job +techsith thanks for helping out the community

    • @Techsithtube
      @Techsithtube  9 лет назад

      +Maxwell Lasky Really appreciate your comment. This really motivates to make good tutorials. :)

  • @mahmoudhassen4463
    @mahmoudhassen4463 3 года назад

    Thanks for your clear explaination. IDK why nobody talks about these useful methods.

  • @souravkaranjai6428
    @souravkaranjai6428 8 лет назад +1

    This is a wonderful tutorial. The explanation is super simple to understand. Reading the documentation at the MDN site on this topic drove me nuts. Thank you for making this video.

  • @wilfredomendez3450
    @wilfredomendez3450 7 лет назад +1

    Clear, concise and to the point. Thanks.

  • @paulosilva-dm1qb
    @paulosilva-dm1qb Год назад

    With you Sir it´s always clear, Thanks!!!!!!!!!!!!!

  • @Teteu.freitas
    @Teteu.freitas 3 года назад

    Despite it's an old video, it's very acctual, and very good explained! Thanks

  • @vinsonchuang7950
    @vinsonchuang7950 9 лет назад

    When I finished watching this video, subscrible right now! Perfect tutorial...

  • @Benas210
    @Benas210 7 лет назад +1

    Really fan of your tutorials, one of the best tutorials on complex topics I seen so far. Thanks a lot

  • @allanonyango6447
    @allanonyango6447 4 года назад

    I have understood your explanations and cleared my doubts...Thank you

  • @shashanksharma3177
    @shashanksharma3177 7 лет назад

    i was trying to get it from lot many days , but this was simply best explanation .
    Thanks for sharing.

  • @khalidhashimeh
    @khalidhashimeh 7 лет назад

    great video..like you said at the beginning of the video, this concept is really confusing in JavaScript, and you made it very easy to understand..it's not confusing anymore..thank you..

  • @andrewmartin4045
    @andrewmartin4045 8 лет назад +4

    Concise and effective tutorial. I bookmarked this video as I struggle with these concepts and get clarification every time I rewatch it. Keep up the great work!

  • @atultronixs
    @atultronixs 7 лет назад +1

    Great explanation, useful

  • @kangchen2101
    @kangchen2101 8 лет назад

    Great tutorial! I can also use call, apply, and bind in nested function
    // call, apply and bind with nested function
    // it can be called as a closure
    var main = {
    num: 2,
    outer: function() {
    inner = function() {
    console.log(this.num);
    };
    inner.call(this); // 2
    inner.apply(this); // 2
    var bound = inner.bind(this);
    bound(); // 2
    }
    };
    main.outer();

    • @Techsithtube
      @Techsithtube  8 лет назад

      Yes, you are correct you can also use it like this.

  • @abhayagarwal5097
    @abhayagarwal5097 4 года назад

    Tysm man,i just started learning js and got stuck with the ambiguous explanation in tutorials on net,so decide to look on RUclips and you just made all my doubts cleared or i would have even given up on learning JavaScript !

  • @ameyapatil1139
    @ameyapatil1139 5 лет назад +1

    Great video

  • @yakirnaim3900
    @yakirnaim3900 6 лет назад

    Really thank you
    ive had a hard time with bind and you explained it very easly

  • @prabhatkumar08
    @prabhatkumar08 7 лет назад

    Supereb ...how easily you explain this. Very good job, Thanks A lot.

  •  5 лет назад +1

    Crystal clear! Thx!

  • @rajivbagade
    @rajivbagade 8 лет назад +1

    good to understand in a simple way
    Thanks.

  • @anuragsharan3096
    @anuragsharan3096 7 лет назад

    You explained so well. Thanks for your effort.

  • @swarasworld4439
    @swarasworld4439 7 лет назад +2

    Very Well Explained ...Thank You.

  • @md.imanali9998
    @md.imanali9998 7 лет назад +1

    Clear explanation. It's really good

  • @kushalkumar4970
    @kushalkumar4970 4 года назад

    Thank you so much for the very simple explanation!

  • @bhuwandevshali6688
    @bhuwandevshali6688 8 лет назад +1

    This was so simple :) MDN has a million page documentation on call, apply and bind :)

    • @GerardoBelot
      @GerardoBelot 8 лет назад

      +Bhuwan Devshali Absolutly true XD

  • @ajithanageswari4642
    @ajithanageswari4642 6 лет назад +1

    Clean and Neat explanation

  • @jeffersonteng988
    @jeffersonteng988 7 лет назад +1

    Nice video, explains it very clearly using a simple example. Props for u

  • @vaibhavatiitm007
    @vaibhavatiitm007 8 лет назад

    awesome explanation by a simple example..really awesome

  • @SHUBHAMGUPTA-ls2dr
    @SHUBHAMGUPTA-ls2dr 3 года назад

    Best explanation ever I have found for this😁

  • @dubeykivines9202
    @dubeykivines9202 4 года назад

    It was never so easy ever to understand this tough concept. Big thumbs up 👍 to you Man.

  • @krishnabala7359
    @krishnabala7359 5 лет назад +1

    Great and awesome bro .... You're making many lives easy with all these

  • @RobinSingh-ms3zt
    @RobinSingh-ms3zt 5 лет назад +1

    Nice video great explanation thanks.

  • @crispe1586
    @crispe1586 5 лет назад +1

    This tutorial was so amazing and eye-opening, thank you so much!

    • @Techsithtube
      @Techsithtube  5 лет назад

      Also check it out the applications of call apply and bind. ruclips.net/video/AYVYxezrMWA/видео.html

  • @santra528
    @santra528 4 года назад

    Thank you @techsith. You have explained this confusing topic very easily and cleared the doubts. Thanks once again. Keep rocking!!

  • @stevenjchang
    @stevenjchang 8 лет назад +4

    Wonderful job, your explanation was exceptionally clear. Good lecture style
    Thanks!!

  • @demiansims728
    @demiansims728 5 лет назад +1

    Great explanation and crucial for understanding when you get into frameworks like React

    • @Techsithtube
      @Techsithtube  5 лет назад

      Feel free to check out the next video on the applications of call apply and bind on my channel .

  • @ASHASCREATIVITY
    @ASHASCREATIVITY 5 лет назад

    Usefull video

  • @satishchandra4785
    @satishchandra4785 3 года назад

    Techsith is best every time ❤️...Whenever there is an ad on his videos, man I click twice as a thank you and to support.

  • @safwanmohammed7715
    @safwanmohammed7715 5 лет назад +1

    Best explained

  • @xuelianwang5300
    @xuelianwang5300 6 лет назад

    Very clear explanation! Thank you!

  • @SimKieu
    @SimKieu 3 года назад +1

    Thank you! Best explanation I've seen!

  • @jeong1780
    @jeong1780 2 года назад

    thanks for the clear explanation! appreciate this video!

  • @ciolea
    @ciolea 7 лет назад

    nice tutorial, it will be handy for the JavaScript exam tomorrow :D

  • @lq9271
    @lq9271 6 лет назад

    Great video! Helped so much, saved lots of researching time.

  • @chlv1987
    @chlv1987 8 лет назад

    Thanks for the clear and detail explanation.The video was really helpful to me to understand the differences between the 3 ways.

  • @404GHXST
    @404GHXST 9 лет назад +1

    Clearest explanation i've ever seen!

  • @scottmoses2574
    @scottmoses2574 8 лет назад

    these are really great examples. Thank you.

  • @christopherkellett8738
    @christopherkellett8738 7 лет назад +1

    Thanks, really clear introductory explanation.

    • @Techsithtube
      @Techsithtube  7 лет назад

      Thanks for watching Christopher! :)

  • @eddiemuller3157
    @eddiemuller3157 8 лет назад

    Excellent explanation. I just got something going that I've been looking at on and off for the past two days by fully understanding .apply() :)

  • @muhammadainuddin4650
    @muhammadainuddin4650 4 года назад

    Great video, Awesome explanation

  • @Marinakulichok
    @Marinakulichok 7 лет назад +1

    Thanks for your tutorials !!!

  • @nitiholkar3352
    @nitiholkar3352 2 года назад

    Nice one , 🥰

  • @AshwiniSurve2307
    @AshwiniSurve2307 8 лет назад

    Awesome explaination method :) Thanku very much!

  • @mrsabarinath1
    @mrsabarinath1 7 лет назад +1

    simple and good explanation.

  • @maxwong4657
    @maxwong4657 7 месяцев назад

    the most clear tut on this topic! thx

  • @krishnendubhattacharyya2193
    @krishnendubhattacharyya2193 5 лет назад +1

    Thanks. Your video is really nice.