I\'m making a Javascript class and I\'d like to have a public static field like in Java. This is the relevant code:
export default class Agent {
CIRCLE:
In current drafts of ECMAScript 6 (as of February 2015), all class properties must be methods, not values (note in ECMAScript a "property" is similar in concept to an OOP field, except the field value must be a Function object, not any other value such as a Number or Object).
You can still specify these using traditional ECMAScript constructor property specifiers:
class Agent {
}
Agent.CIRCLE = 1;
Agent.SQUARE = 2;
...