JavaScript Question: Why are JavaScript Functions First Class?

  Рет қаралды 17,537

All Things JavaScript, LLC

All Things JavaScript, LLC

Күн бұрын

Пікірлер: 35
@eieiei649
@eieiei649 5 жыл бұрын
Teaches you what you came here for, no beating around the bush whatsoever. Thanks!
@RameenFallschirmjager
@RameenFallschirmjager 4 жыл бұрын
Your videos are such rabbit holes! When you watch one, you need to watch others too!😂
@hiteshj2110
@hiteshj2110 5 жыл бұрын
This cleared A LOT OF BASIC which I needed the most. Thank you so much. Very well explained.
@touseefahmad9794
@touseefahmad9794 Жыл бұрын
I never ever seen teacher like you.!
@AllThingsJavaScript
@AllThingsJavaScript Жыл бұрын
Thanks! I appreciate it!
@rncongi6641
@rncongi6641 3 жыл бұрын
Such a great teacher! Thank you so much for making these tutorials clear, to the point and easy to understand!
@AllThingsJavaScript
@AllThingsJavaScript 3 жыл бұрын
Thank you so much and glad they are helpful.
@JCMLR
@JCMLR 6 жыл бұрын
Best explanation so far! *subscribes*
@gargameo4560
@gargameo4560 6 жыл бұрын
On 02:00 you say "when you place variable in a function"...But you really placed a function in a variable. Am I wrong, or is tat a lapsus?
@AllThingsJavaScript
@AllThingsJavaScript 6 жыл бұрын
Yes, you are correct. I placed the function in the variable and meant to say that. :-) Hopefully that didn't mess anyone up.
@maenam4520
@maenam4520 10 ай бұрын
Great explanation going to see all available videos on your channel. Thanks
@AllThingsJavaScript
@AllThingsJavaScript 10 ай бұрын
Thanks and welcome
@mayanksati1842
@mayanksati1842 5 жыл бұрын
Loved your explain. This explanation with examples finally made me understand first class functions.
@austinabraham1903
@austinabraham1903 5 жыл бұрын
Thank you, very helpful
@binhtruong3373
@binhtruong3373 3 жыл бұрын
very clear explanation, thanks.
@FitnessChaos
@FitnessChaos 5 жыл бұрын
good explanation chief
@ashrafulhaque8710
@ashrafulhaque8710 4 жыл бұрын
Finally, I got it! Thanks a lot.
@TechBison
@TechBison Жыл бұрын
This is where you learning JavaScript deep but easy....
@jainshilpi3
@jainshilpi3 7 жыл бұрын
can u make some tutorial making? a small application using OOps concepts of javascript
@AllThingsJavaScript
@AllThingsJavaScript 7 жыл бұрын
I will add that to the list. It may be a while as this takes more time, but if you need this right away you can check out my advanced course: www.allthingsjavascript.com
@RyanScottForReal
@RyanScottForReal 5 жыл бұрын
Very useful thanks
@mikebutak
@mikebutak 7 жыл бұрын
very helpful thank you!
@adamrohde3513
@adamrohde3513 3 жыл бұрын
I appreciate this video, but I think a very important piece wasn't stressed enough. I could be off base on this, so obviously correct me where I'm wrong, but to me this doesn't make any sense, (or its meaningless ) If I'm not familiar with the idea of int myNum = 123 string myString = "hi" float myFloat = 123.123 And not being able to do - myNum = myString; (won't compile it most languages) The important part is JS doesn't decipher between primitive data types and objects/functions. And this is all seen first hand with the code you wrote with one word. VAR! Var is the "feature" that allows functions to be first-class.. no? I feel like Var should be the takeaway. All of the code you wrote could of easily been replicated in many languages but very few that I'm familiar with could of done it by only using one "data type"
@AllThingsJavaScript
@AllThingsJavaScript 3 жыл бұрын
I hope I'm understanding what you are getting at, but var is not really the magic sauce. We can define it with let or const. We can also do a regular function definition. It is simply the fact that a function can be assigned to a variable and then passed around. Simple example: function test() {console.log('test');} const t = test; t();
@adamrohde3513
@adamrohde3513 3 жыл бұрын
​@@AllThingsJavaScript Yes, you are right. Maybe I didn't describe myself well. My point is the idea of "first class functions" I think is very hard to understand without knowing the alternative. Without having some familiarity with programming languages where functions aren't "first class". Any language, first-class or not, could have created the same functionality as you did in this video. But they couldn't have done it with one universal, one size fits all "variable" (var, or let, or const). Data types would have to be defined and respected. If you wanted to pass the value 123 into a string variable, operations like casting would have to be done to make that happen. It doesn't just happen, like in JS. So yes, var specifically isn't the special sauce but the absence of any other data type is the special sauce. And a new programmer without having experience in a language like java or c++ isn't going to appreciate the benefit of var myVar = "Hello World", without first stuggling to make int myVar = "Hello World" compile.
@AllThingsJavaScript
@AllThingsJavaScript 3 жыл бұрын
@@adamrohde3513 Got it! Thanks for your input!
@adamrohde3513
@adamrohde3513 3 жыл бұрын
@@AllThingsJavaScript And thank you for creating the content!
@denniskamonde6836
@denniskamonde6836 6 жыл бұрын
Thank you
@Alison-yg6qs
@Alison-yg6qs 5 жыл бұрын
thank you!!
@liyan542
@liyan542 5 жыл бұрын
Thumbs up!
@chrisplusplus6232
@chrisplusplus6232 5 жыл бұрын
thanks!
@seenuvasanv
@seenuvasanv 7 жыл бұрын
Thanks
@georgesmith3022
@georgesmith3022 6 жыл бұрын
Javascript can be a bit confusing. Functions are typeof Objects but are treated as values!
@AllThingsJavaScript
@AllThingsJavaScript 6 жыл бұрын
The way I think of it is objects can be passed around in JavaScript like values.
Using Immediately Invoked Function Expressions (IIFEs)
7:58
All Things JavaScript, LLC
Рет қаралды 6 М.
The Basics of JavaScript Objects
13:16
All Things JavaScript, LLC
Рет қаралды 19 М.
The Lost World: Living Room Edition
0:46
Daniel LaBelle
Рет қаралды 27 МЛН
Andro, ELMAN, TONI, MONA - Зари (Official Audio)
2:53
RAAVA MUSIC
Рет қаралды 8 МЛН
Counter-Strike 2 - Новый кс. Cтарый я
13:10
Marmok
Рет қаралды 2,8 МЛН
JS is Easy, Part 7: First-class Functions
15:25
Source Decoded
Рет қаралды 1,3 М.
Demystifying JavaScript Closure
16:08
All Things JavaScript, LLC
Рет қаралды 27 М.
Higher Order Functions: A JavaScript Strong Point
8:15
All Things JavaScript, LLC
Рет қаралды 26 М.
Higher Order Functions - JavaScript Tutorial
10:10
ColorCode
Рет қаралды 71 М.
JavaScript Fundamentals: Best Practices
15:01
All Things JavaScript, LLC
Рет қаралды 23 М.
JavaScript Question: What is a Prototype?
10:48
All Things JavaScript, LLC
Рет қаралды 39 М.
Learn DOM Manipulation In 18 Minutes
18:37
Web Dev Simplified
Рет қаралды 1 МЛН
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
Understanding JavaScript Callbacks
15:39
All Things JavaScript, LLC
Рет қаралды 115 М.
The Lost World: Living Room Edition
0:46
Daniel LaBelle
Рет қаралды 27 МЛН