The 'call' Method in JavaScript | Function Call Explained

preview_player
Показать описание

It is similar to the 'apply' method in that it allows you to specify the value for 'this' however you pass in arguments separated by comma using the call method.

In this video I take you through a simple example of the call method, showing you exactly what it does and being as simple as possible.

For your reference, check this out:

Follow me on Twitter @dcode!

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Рекомендации по теме
Комментарии
Автор

Finally, after 6 years of wondering how best to understand this method, I find the perfect answer! thank you brother!

WebSurfingIsMyPastime
Автор

I'm even more confused now. What's call() good for? When would I need it?

xena_
Автор

I was reading the mozilla docs on this and I didn't understand it, now I get it :)
You're explaining really well!!

rolandcucicea
Автор

Very simple explanation. It would be good to see an example with better context, like a more real life situation when I need to use .call()

jykl
Автор

Thanks for all the tutorials man ! You always keep it simple and easy to understand.

getrogo
Автор

You really made the concept crystal clear. thanks

nadeemakramansari
Автор

Thanks mate, it's gold! Specially for pointing out the relation btwn .call and .bind.

Mvrck
Автор

As we regular function like function name(){ }
then what is the use of using call() method with regular function, I think we can do the same, would you tell me something extra to clear my confusion that when we need to use call method in function as you have used in the video, , , , plz?

simple
Автор

Thanks mate. This is great vedio for begginers in JavaScript Language.

chapman
Автор

really, really dope, thanks for this incredible video. cheers!!!

RicardoSilva-cpol
Автор

what keyboard do you use? and whate type of keys are they? they sound so good!

johnnyholiday
Автор

what will happen if we are using .call() on es6 arrow function ?, is it same the thing or ?

OynarsanOyna
Автор

Thanks for the tutorial! Dude, your keyboard sounds AMAZING, can you drop the name and/or specs? thank you! <3

brunascauri
Автор

If you put playlist in order it will be very useful for beginner to learn from scratch. (especially in JS)

prabu
Автор

If you're calling a specific function and changing the value of the "this" keyword then the question remains as to what purpose the call was made to that function.

colindante
Автор

Is the JavaScript video tutorial is in Order sir? Or jumbled ?


I hope you reply soon

prabu
Автор

It doesn't work for me when I use ('${first} ${last}');

Felix-bhtc
Автор

Is this the same if you code in the developer console

sapphiredeer
Автор

If you are talking to genuine CODE DEVELOPERS perhaps this makes all perfect sense. BUT, to someone like me you dont and the reason is you have jumped right into the code without explaining or showing what you are trying to do in the first place. SHOW US the BEFORE AND AFTER WEBSITE and then show us the code so it can make better sense please. The code is does not seem difficult but really explains nothing to me.

williamjamesrapp