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"
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();
@@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.
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
Teaches you what you came here for, no beating around the bush whatsoever. Thanks!
Your videos are such rabbit holes! When you watch one, you need to watch others too!😂
I never ever seen teacher like you.!
Thanks! I appreciate it!
This cleared A LOT OF BASIC which I needed the most. Thank you so much. Very well explained.
Such a great teacher! Thank you so much for making these tutorials clear, to the point and easy to understand!
Thank you so much and glad they are helpful.
Best explanation so far! *subscribes*
Great explanation going to see all available videos on your channel.
Thanks
Thanks and welcome
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?
Yes, you are correct. I placed the function in the variable and meant to say that. :-) Hopefully that didn't mess anyone up.
Loved your explain. This explanation with examples finally made me understand first class functions.
very clear explanation, thanks.
This is where you learning JavaScript deep but easy....
Thank you, very helpful
good explanation chief
Finally, I got it! Thanks a lot.
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"
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();
@@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.
@@adamrohde3513 Got it! Thanks for your input!
@@AllThingsJavaScript And thank you for creating the content!
Very useful thanks
can u make some tutorial making? a small application using OOps concepts of javascript
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
very helpful thank you!
Thank you
thank you!!
thanks!
Thanks
Thumbs up!
Javascript can be a bit confusing. Functions are typeof Objects but are treated as values!
The way I think of it is objects can be passed around in JavaScript like values.