DEV Community

Javascript private fields are coming

Warren Parad on May 15, 2019

Turns out that node stage 3 right now we will have private class properties. And it is exactly as you thought it would be: class Point { pri...
Collapse
 
samuraiseoul profile image
Sophie The Lionhart

I keep reading this article and it keeps infuriating me. Fuck what a dumb proposal. I love encapsulation and the idea of private fields is GREAT. Not like this though, I'd rather not have private fields than this. This is a language feature that will get JS on a path to having a "JS, a fractal of bad design" written about it.

Collapse
 
wparad profile image
Warren Parad

Have a :hug: :)

Collapse
 
samuraiseoul profile image
Sophie The Lionhart

Thanks, I'm gonna need it. Hopefully Typescript will make it so I never have to see this directly. T_T

Collapse
 
devhammed profile image
Hammed Oyedele

It is working already in my Chrome 74 console.

Collapse
 
itachiuchiha profile image
Itachi Uchiha

Who could love this kind of access modifier?

Actually, private and public keywords are enough. They wanted to do weird things and did. :/