re: 7 Exciting New JavaScript Features You Need to Know VIEW POST

re: Nice list! Really looking forward to these. I still think private fields prefixed with "#" is crazy and shouldn't have been accepted, but the rest ...

I had the same feeling at first. Then I read the reasons behind it and it made some sense. Long story short: in a dynamically typed language, giving the engine a hint whether the property you're trying to access is public or private makes it much easier to implement without exposing details of internal private fields. Here's the reasoning behind it

Another advantage of it is that linters can also understand if you're trying to access a private property outside its class and warn you, which would be impossible without a special identifier

code of conduct - report abuse