Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It might interest you to know JS has real private fields, formally introduced in ES2022. [1]

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...



Who wants to bet that GP never reads that link and proceeds to continue to complain about the same outdated JavaScript issues for the next two decades.

Not to mention the fact that GP's issue only matters if you're using classes. You can define module-level variables and simply not export them and they are 100% private. Or, they can just define the variable inside of a function and protect it by a closure. I can't imagine writing multiple paragraphs of complaints about a language that I don't actually understand how to use.


I've read it and I agree private properties on classes satisfy the requirement. It does allow you to hide implementation details and I was unaware it was added; though with anything JavaScript you can usually find a way around it.

However I don't really want to talk to you. You are rude.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: