How to create static class constants in ES6

ES6 brings classes to JavaScript, but some things are not immediately obvious or entirely supported. For instance, there is no obvious way to create static class constants. Here is the simplest way I have found to create constants: class CurrentLocation { static get GEOLOCATION_ERROR() { return ‘GEOLOCATION_ERROR’; } static get GEOLOCATION_REFUSED() { return ‘GEOLOCATION_REFUSED’; } […]