Up until now I was sure a function which returns a function is a quantum operator
zxzxzzxx
there is a similar consept in functional languages called partial application ( which would be more mathematical definition than closure)
someone_
We can just check the same by saving it in a variable and simply use it in a function right? Then if it is mot used in this case. Could you make a video on closure actual use case rather than example case
eswarbalasubramanian
The example is showing the concept correctly, but the definition is not. A closure occurs when a function is CREATED in another function. The inner function can be stored somewhere and not necessarily returned. Similarly, functions being first class objects can be returned from a function, as a reference from somewhere else, in which case no closure is involved. So the statement "closure always occurs when a function returns a function" is not correct.
I understood the program but I don't understand closure concept 😢