Pure and Higher Order Functions
Vložit
- čas přidán 27. 09. 2018
- This tutorial covers two programming concepts that you need to understand functional programming. It discusses pure functions and higher order functions, both within the context of JavaScript.
Code GIST: gist.github.com/prof3ssorSt3v...
If there wasn't people like you, I would have given up learning code. Thanks.
You're a great teacher thank you
You're a great teacher. I appreciate the time and effort you put into these.
Brilliant! Thank you 😊
Thank you that was very clear :)
Thank you Steve.
Great video, thx.
Wow. Thank you !
Dear Steve, I watched your video about callback functions. My question is, a higher Order Function needs a call back function?
The Higher Order function can accept and return any function reference. It doesn't have to be a callback function that you are passing around.
So, higher order function is basically a function that return the result of another function which is ran inside it?
A high order function is basically a function that takes another function as argument, that's it.
Does Higher Order Function is also Currying Function and Closure?
currying and closures are different things than higher order functions. However, they can be combined.
console.log('x return value'); when this will going to return?
Not sure what you are asking here.
console.log('x return value'); when this will print? When I run programme I get just x at console.
@@amarg26 it sounds like you have quatation marks around the variable. That will make it a string instead of a variable
_output is now a function. You are bound to call it
line 14: return _output();
@@SteveGriffith-Prof3ssorSt3v3 I have it written exactly like how it's in the video, and console.log('x return value') does not print for me either. Am I missing something? I also want to thank you, your videos have been helpful.
🤔not so sure
I don't know if my brain just can't handle high-order functions but I just can't seem to grasp the concept :(
Different concepts take different amounts of time to make sense for different people. Keep practicing and coming back to the concepts you dont understand yet. Eventually you will get the lightbulb moment.
@@SteveGriffith-Prof3ssorSt3v3 I will defintely be coming back until I understand this. I just have a trouble I think following the control flow of a higher order function. Like with other functions it makes sense what happens after what, but I dont quite understand that with high order functions
Can a Higher Order Function be a Pure Function?
Sure. As long as the function always returns the same thing for the same input.
@@SteveGriffith-Prof3ssorSt3v3 Great... Thanks for the clarification!