-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
private Members #8847
Comments
I gave a different solution than your example why is this duplicate? |
Try running your proposed code with two instances of Foo and see what happens. It doesn't work. Suffice to say if there were a good simple solution here, we would have done it. There are no small clever tricks that generate private members without seriously bad trade-offs. |
But I tried... I would never post a solution if I wouldn't test it before... due to var a = {}, b = {a:a}; a === b.a will return true , the privates object will creates privates for each instance of foo. In case you use the new Operator. |
ya, seems to be in my check i typed last line x instead y :D
|
Now doing something with a list of |
i don't get it... its too slow? or what's the matter? |
O(n^2) complexity to walk a list of n elements and access their private members is too slow, yes. |
hm... seems to be that i am not programming in high performance :D |
Hey @Mephiztopheles, it's called Big O Notation. Check out a simple explanation or a more in-depth one on Wikipedia for more details. |
HI, i wanted to look at typescript and saw, that private members are not really private in console :D
i searched in your FAQ and found an entry to this, but i think this might be a solution for private members.
TypeScript Version:
1.8.9
Code
Wished behavior:
Actual behavior:
The text was updated successfully, but these errors were encountered: