4 ms·
> In the functional example, where does Person store the fName and lName variables? Is there an intrinsic/hidden 'this' pointer? If functions persist data, are
by chrisrhoden 6y ago
> In the functional example, where does Person store the fName and lName variables? Is there an intrinsic/hidden 'this' pointer? If functions persist data, are they really classified as functions anymore?
There is no intrinsic "this", the code as presented is using a closure. Closures are typically considered a standard part of functional programming.
- euiq 6y agoNote that the example in the post only works because variables in the closure can be rebound. Not every language allows you to do that.