Callbacks in JavaScript Explained!

Callbacks in JavaScript Explained!

Code with Ania Kubów

3 года назад

153,417 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@91dgross
@91dgross - 24.03.2023 01:10

Thanks for the video, i just want to say one thing; you said setTimeout takes ( firstAction, 5000) as parameters, but those would be arguments.

Ответить
@mjowta
@mjowta - 25.03.2023 17:33

great explain ania thanks

Ответить
@jahidulhasan8558
@jahidulhasan8558 - 28.03.2023 18:16

love

Ответить
@shaidyn8278
@shaidyn8278 - 03.05.2023 22:57

Good gravy, you did it. You made arrow functions make sense. I've watched a half dozen tutorials and it was like water through a sieve. => just replaces 'function' and gets shifted forward. It's that simple.

Ответить
@unknown-ry6dj
@unknown-ry6dj - 04.05.2023 13:12

I love you my JS Teacher ❤❤❤❤

Ответить
@nurlannuruzad1739
@nurlannuruzad1739 - 13.05.2023 23:02

thanks ! this explanation is wonderfull and helpful !!!

Ответить
@BusinessDevelopmentSolution
@BusinessDevelopmentSolution - 20.05.2023 07:23

You tried hard to explain but it's so complicated for the beginners

Ответить
@Srishti9015
@Srishti9015 - 02.06.2023 04:31

This was an amazing video, i have been programming for a while now without fully understanding this concept but you drilled it down so perfectly. Thank you so much!! Go girl!! Off to check out the rest of your videos 😊

Ответить
@hirookenji
@hirookenji - 13.06.2023 16:41

How in the world you made it so easy for us? It actually feels illegal to watch this video lol.
I watched a lot of tutorial but this is the best and has the best explanation.

Ответить
@aocchan
@aocchan - 16.06.2023 18:50

Thank you, I tried other tutorials but never really understood much, yours however was clear and easy to follow.

Ответить
@germansilva7947
@germansilva7947 - 22.06.2023 01:05

omg i cant believe this was getting me so confused. Big thanks!!

Ответить
@yatin1370
@yatin1370 - 23.06.2023 08:01

There is one more thing, you need not necessarily pass a callback method's parameter with ()=>
You can just mention the 'method name' in the calling method's parameter list as usual, then within the body of calling method you can call the callback method passing another parameter of the calling method.

For eg:
function first(callback, message) {
console.log(message);
setTimeout(() => callback(message), 3000);
}

function second(radio) {
console.log(`This is ${radio} FM!`);
}

first(second, "Fever 105");

This drove me nuts while understanding below example as to why the parameter was not passed initially:

function asyncForEach(array, cb) {
array.forEach((el) => {
setTimeout(() => cb(el), 3000);
});
}

asyncForEach([1, 2, 3, 4], function (i) {
console.log(`This is me: ${i}`);
});

Hope this helps someone.

Ответить
@nguyennghialan
@nguyennghialan - 29.06.2023 01:57

The best part is using arrow function to make a callback with input parameter. I understood. Thanks,

Ответить
@TheSmoothPower
@TheSmoothPower - 02.07.2023 18:57

Excellent explanation.

Ответить
@teclyt_solutions3839
@teclyt_solutions3839 - 08.08.2023 12:51

This has really helped me and the content is much easier to understand. Thanks a lot.

Ответить
@vaughanmacegan4012
@vaughanmacegan4012 - 10.08.2023 12:53

Coming from game programming in C++ I don't get this at all - I'll guess I'll have to play with this for a while. I am used to all functions having names and calling them as I need to. Not this eosoteric system of functions being anonymous by the sounds of it. Oh well, thanks for trying to explain it, it looks like others found it useful.

Ответить
@Coding1on1
@Coding1on1 - 15.08.2023 19:40

You are a great teacher, thank you.

Ответить
@stefanpatrichi2608
@stefanpatrichi2608 - 17.08.2023 22:28

I tried, but I cant understand

Ответить
@itsnobledean9450
@itsnobledean9450 - 08.09.2023 03:33

I can't even lie, I'm confused as hell after watching this. Sometimes it'll take me some time to grasp a subject, but damn, I just couldn't get her explanations. I don't know how I can say that her explanations were complex, but they were to me. I'll have to find another video.

Ответить
@DADesigns41
@DADesigns41 - 25.09.2023 18:45

Ответить
@SnobbyLion
@SnobbyLion - 06.10.2023 04:11

Thank you coding Targaryen

Ответить
@kellybrian3218
@kellybrian3218 - 10.10.2023 11:42

tough

Ответить
@ammarahmedkhan2416
@ammarahmedkhan2416 - 10.10.2023 21:38

That was mind-blowing. You explained it so well. Thank you❤❤

Ответить
@mahmodsamir5110
@mahmodsamir5110 - 26.10.2023 14:26

Straight to the point, really helpful and simple
Thank u very much ❤

Ответить
@elikent78
@elikent78 - 03.11.2023 21:25

thank you!!!! for the first time I'm starting to understand this concept

Ответить
@anthonyobot6529
@anthonyobot6529 - 05.11.2023 18:32

I have watched coupled of times and I still find it difficult to comprehend

Ответить
@СофияБаширова-щ9ю
@СофияБаширова-щ9ю - 10.11.2023 22:23

Couldn't grasp the concept of callback functions until I found your video. Thank you very much! You helped me understand it

Ответить
@awaiskhan-bd7cr
@awaiskhan-bd7cr - 27.11.2023 12:56

my first video and you owned me

Ответить
@ScottUmphrey
@ScottUmphrey - 05.12.2023 19:56

A very good tutorial on callbacks. Keep up the good work.

Ответить
@rigobertorosa2949
@rigobertorosa2949 - 13.12.2023 20:09

Javascript the love and hate relationship

Ответить
@RogerontheKeys
@RogerontheKeys - 22.12.2023 11:25

thank you, i feel like i'm at a better spot then i was 10mins ago learning about callbacks for the first time.

Ответить
@GanishiRanaweera-ip3uo
@GanishiRanaweera-ip3uo - 03.01.2024 07:19

You are amazing!❤

Ответить
@Hariharan0606
@Hariharan0606 - 18.01.2024 11:42

I never knew this before! Thank you so much

Ответить
@wiliam334
@wiliam334 - 25.01.2024 21:18

Thanks for the video. Very helpful.

Ответить
@ella6782
@ella6782 - 27.01.2024 21:14

Wow. Really understood what you taught.❤❤❤❤

Ответить
@eftihisbotonakis7204
@eftihisbotonakis7204 - 15.02.2024 08:52

I don’t know why this seems so hard to grasp to me. I’ve been trying all morning

Ответить
@OUTSS1
@OUTSS1 - 16.02.2024 20:03

such a good teacher!

Ответить
@maenam4520
@maenam4520 - 25.02.2024 05:37

+1 sub

Ответить
@THE-Nerd09
@THE-Nerd09 - 01.03.2024 17:37

❤now i understand the js
you explain very nice

Ответить
@Rayhan-hossain-sobuj
@Rayhan-hossain-sobuj - 04.03.2024 16:54

deneryes targeryan is here...

Ответить
@SarFirraEdits
@SarFirraEdits - 11.03.2024 21:27

My question to you is how you can genuinely love to code everyday? I just love the vibe of the video from intro to the point you start coding. The moment it starts to show up scary lines of code with multi colours on a black screen oh my heart just starts beating fast and i start to feel anxious and nervous. How can you be ok with liking this dark screen of code? How can one love that? Eventually one needs to love that dark screen first then the exciting gaming part later😢😢😢😢

Ответить
@gundamfortress
@gundamfortress - 26.03.2024 21:09

Question: a callback function works only if the function has no parameters? E.g. "toggle('aString')" does no longer work as a callback function? Thanks for your answerz 😀

Ответить
@emreucar7370
@emreucar7370 - 12.06.2024 13:30

Thank you :)

Ответить
@KenechukwuOjiteli
@KenechukwuOjiteli - 18.06.2024 10:55

Thank you, this was very helpful

Ответить
@magnieduardo8570
@magnieduardo8570 - 08.07.2024 15:04

Lovely explanation, thank you Ania you made my day...

Ответить
@MohammadAsfour-x8k
@MohammadAsfour-x8k - 22.07.2024 13:35

very confusing.

Ответить
@sophiahitch726
@sophiahitch726 - 23.07.2024 12:23

time to practice

Ответить