
005 JSJ Javascript Objects
JavaScript Jabber
00:00
How Do You Get Access to Private Data in the Closure?
Private data is always contained within the closure, and not necessarily within the object that's being returned. The canonical example to this would be if you have an object that is a incrementr, and you don't want to expose t, the number for some reason,. So what you do is you inside of the constructor, you say, like, vr i equals zero. And then you say this dot incer equals function i plus plus, right? So amat. You provide a way to modify ey in aancient way. Then you callo, provide another thing that exposes ey in a way that you find important.
Play episode from 27:19
Transcript


