Once You Realize This You Will Never Struggle With Callbacks Again

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


🌎 Find Me Here:

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

Wouldn't it be more correct to say that both variables and functions are objects instead of saying that functions are variables?

djnefrozhardstylepromotion
Автор

Functions don't work like objects, functions ARE objects.

yadusolparterre
Автор

It's one of the things I most like about JS. My favorite thing is being able to store different functions in array elements and hash maps, and then invoke them using array indexing or hash key lookup.

It's also why some people will write "function test() {...}" and others prefer to write "const test = function() {....};"

OneAndOnlyMe
Автор

You have quicky become my go to guy. Wow you are such a good teacher. Thank you so much.

Andy-sipl
Автор

This why in JS they call function is First Class CItizen, because you can pass them, return them. But also this is just beginner friendly to said function is variable, in fact they are Object. "Everything in JS is Object"

minercreepmc
Автор

It's not the passing of a function, but the untidy manner of writing a whole function inside the parentheses.

technicalboy
Автор

that makes much more sense, now, I thought when you call a function it gets executed and the result/return is passed. Now that you and some other peeps here mentioned that a function is an object makes almost everything clear! Thanks!

letter_m
Автор

To any beginners almost everything except primitive data types are objects in JS. That's why you can do stuff like this. Functions are objects, arrays are objects, window is a object and so on

deveshrawool
Автор

How the hell do you have such perfect hair? We need a haircare tutorial :-)

themarksmith
Автор

And objects are passed by reference in javascript. so when you call test2() or test() in both cases you are calling same function, the anonymous function which it's reference was saved in test 1, not two functions with same functionality.

pooyaestakhry
Автор

"functions are just variables": Functions can be (and usually are) _assigned_ to variables/defined using a name.
But you can still have things like _anonymous_ functions.
A better clickbaity thumbnail text might be "functions are just objects"
I know you know this, but I needed to vent this upon reading the above title in the thumbnail :P

black_platypus
Автор

You are so cool. It's easy to understand the concepts.

muto
Автор

Callback functions are freaken awesome.

AshtonMotana
Автор

"The fact you can pass a function to
another function in javascript is really
confusing to a lot of people"
Me whos been a python dev for 5 years and switched to js my 6th (now in my 7th year): Lies.

mavdotj
Автор

The way I think about it, is that everything is a memory address. A function pointer, points towards a memory address, just like a variable (int32_t, char, etc.)

ryanskelton
Автор

Yeah I pass functions a lot when making a flexible feature

CC-.
Автор

ES6 classes are just functions. Functions are just variables. Therefore, ES6 classes are just variables.

EternalDarknessAboveTheBlueSky
Автор

Your more clearer than my bootcamp lecturer

llemgeta
Автор

Hair is looking thicker each time i watch ur video!

akuajah
Автор

Everything is an object... Even your perfect hair.

professoroflogic