Private and public ES6 class fields are not yet supported outside of Chrome

Created a web app. Used ES6 classes, including the use of private and public fields. Tested the app — all good.

Started to do multi-browser testing and got errors. FireFox was good enough to explicitly mention that class fields are not supported.

I find that if you declare the fields inside the constructor, IntelliSense will still pick them up. Having up-front field declarations, however, does make a class more readable and similar looking to C++ / Java / C#

Field Declaration info on MDN

Tried with FireFox 67.0.2, Edge 44.17763.1.0, and Chrome 75.0.3770.80

Leave a comment