First Class Functions in JavaScript
ฝัง
- เผยแพร่เมื่อ 8 ก.ย. 2024
- Please subscribe: / @devtutsco
JS + TS mailing list: buttondown.ema...
Website: nick.scialli.me
--
JavaScript has first-class functions. This means functions can be treated like other values, which turns out to be incredibly important behavior to understand as you advance as a JavaScript developer. The following three bullets represent important first-class function behavior:
- Functions can be assigned to variables
- Functions can be passed as arguments to other functions
- Functions can be returned from other functions
You helped me so much dude with writing my functional programming paper by letting me understand first-class functions better
Wish you'd spent more time explaining the last part.
We are waiting for the next tutorials. Good job bro👍🏻
yeah thats great job Man !! i was searching for this all around and u know this is Worth Watching !! Please add more videos on javascript ur way of clear and easy explaination can earn u more subscribers :) btw i hit that button :p
Thanks good tutorial can you make tuts about canvas image processing computer vision with javascript
First of all, thank you for the video, it's very understandable. There are 2 things I want to ask:
1. Does the second greeter() method is a callback?
2. On GreeterMarker(), is this a closure?
Great job but I found the tutorial too fast especially for beginners. It gets confusing. When you know something it just rolls of the tongue. If you do a video, do it at a slower pace and assume we don't know anything.
I appreciate the constructive criticism! I’ll make sure to pace myself for future lessons. Thanks!
In the second example, what is the syntax for passing arguments to the function being used as an argument?
if you want to pass a function as an argument and make sure it will be called with specific arguments:
sayHelloToPerson(function () { return sayHello(someArgument, anotherArgument) }, "Jack");
or use an arrow function for a cleaner syntax:
sayHelloToPerson(() => sayHello(someArgument, anotherArgument), "Jack");
so instead of directly passing sayHello as an argument, we create a new anonymous function that calls sayHello with specific arguments and pass _that_ function as an argument instead
98-0 great