First, I had asked is it possible: How to create Javascript constants as properties of objects using const keyword?
Now, I gotta ask: why? The answer to me seems to be 'just because', but it would be so useful to do something like this:
var App = {}; // want to be able to extend
const App.goldenRatio= 1.6180339887 // throws Exception
Why can constants set on an activation object work but not when set on they are set on any other?
What sort of damage can be done if this were possible?
What is the purpose of const
, if not to prevent a public API from being altered?