I'm looking for a way to declare a constant in a javascript class. I thought it may be something like that, but no :
class myClass {
const MY_CONSTANT = 1;
constructor() {
...
}
The goal is to use thoses constant from other methods in the class.
myMethod (add) {
let x = add + MY_CONSTANT;
...
}
Any idea of the correct implementation ? Thanks