When do you need 'bind()'? Indirect vs Direct JavaScript Function Execution Tutorial

preview_player
Показать описание
JavaScript function execution can be tricky - especially using "bind()" can be confusing.

There, you also find the starting source code (and the finished one).

----------

• Follow @maxedapps and @academind_real on Twitter

See you in the videos!

----------

Рекомендации по теме
Комментарии
Автор

I've been looking for a good explanation about the bind and function execution for quite some time, and I found it today on my favorite youtube channel. Thanks, Max. =)

marcus_leon
Автор

Max you are awesome.Your Knowledge and Brain is really powerful.

msvmanikantasrivishnu
Автор

Seriously... I haven't had listened to any tutor so far that can explain things this well. No wonder people call him web-guru. This video is all I needed to understand this concept.

SeriousShone
Автор

Have been searching for a practical explanation for bind for a long time. This one rocks. Subscribed!

ThiagoVieira
Автор

I had the same issue that you mentioned in this video & I configured it out . I didnt know how & it doesnt make sense to me but now I undrastand why . I appreciate that🌹

mohammaddr
Автор

Yesterday I finally understood why we need bind() and today I successfully used it for the first time myself with complete understanding what is going on. Thank you Max. You are a JS ninja

johnconnor
Автор

You, sir, deserve a lot more than you currently have.

peekaboo
Автор

best explanation I've ever seen on the web. This clears things up a lot. Thank you so much!!

jungyunh
Автор

Holy man! What a great explanation is such simple terms. I've read a few snippets on this topic and haven't found anything even close. This covers the "why" and "when" to use. Thnaks for sharing.

crklopotic
Автор

Your are great Max. Best explanation about bind so far 🔥🔥🔥

cesairengaleu
Автор

Hervorragend erklärt Max, danke dafür! Dein React-Kurs auf Udemy hat mich hier hin geleitet.

AnsgarSteinkamp
Автор

Max, I had just finished the .bind() section of your JS course and was still feeling a bit confused on when to use it. I spent a day or so reading through the MDN doc, but not making much headway. Suddenly today, I see this video, and your explanation here really helped to cement the concept in my head! Thank you!

keen
Автор

Very clear explanation! Whenever I need to refresh my memory, I always first check out your channel)

pets_talk
Автор

I've will hate, love, hate and love Max for the rest of my life: the toughest but most brilliant teacher ever. Just a note when Max returns the function it might be even more clear by returning the whole content of the setAsActiveHandler like so


function setAsActiveHandler(goalId, event) {
console.log(event);
return function () {
const selectedGoal = goals.find(g => g.id === goalId);
activeGoalElement.textContent = selectedGoal.text;
}
}
this way at the first pass from the init() function setAsActiveHandler will be saved as a ready to be executed function at the click event by the user.

LorenzoBeltrame
Автор

The best explanation of 'bind' method in the world

johnconnor
Автор

Great explanation!
Maybe you should have mentioned the case when we don't use any arguments in bind and use an event.target inside function on which we called bind method?

nikitaalekseev
Автор

Finally, bind() got bound to my mind. Thanks a lot, Max!

Wakkyguy
Автор

Gerade heute in meine Notizen mit aufgenommen: "bind() recherchieren" und schwups lieg ich abends auf der Couch und dein Upload kommt als Push-Nachricht 👍 Danke!

sebastianjung
Автор

Max, you are awesome. thanks for the idea and avoiding undefined problems when we call the function inside another function.

my_vk_vlogs
Автор

That is the first time I have understood the use of bind, thank you.

paulscoombes