On a Play Framework 2 project if I have any javascript code with this simple statements like that:
const num = 3;
I get the error:
Parse error. Unsupported syntax: CONST
I see that Play Framework has a Javascript Compiler and, from I what I get, minifies your javascript automatically but are consts really not supported ?? It is fundamental language syntax…
source
If you really want it to be non-editable (I DO NOT RECOMMEND DOING THIS), you could use getters and setters:
http://jsfiddle.net/tp2HU/