Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    Thanks @lwburk , I was actually quite curious as to why the prop wasn't destroyed at that end of the constructor, Is this actually considered 'good practice' or should I try an avoid it? Commented Dec 22, 2013 at 9:04
  • @SpencerKillen - closures are a very useful construct in javascript and there is no reason to avoid them if needed. If you want a truly private variable, then a closure is the only way to implement it. Commented Dec 22, 2013 at 9:22