You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Centralizing all event types in a single module would be nice to have.
maybe using Object.freeze:
classMyConstants{}MyConstants.staticValue=3;MyConstants.staticMethod=function(){return4;}Object.freeze(MyConstants);// after the freeze, any attempts of altering the MyConstants class will have no result// (either trying to alter, add or delete a property)MyConstants.staticValue===3;// trueMyConstants.staticValue=55;// will have no effectMyConstants.staticValue===3;// trueMyConstants.otherStaticValue="other"// will have no effectMyConstants.otherStaticValue===undefined// truedeleteMyConstants.staticMethod// falsetypeof(MyConstants.staticMethod)==="function"// true
The text was updated successfully, but these errors were encountered:
Centralizing all event types in a single module would be nice to have.
maybe using
Object.freeze
:The text was updated successfully, but these errors were encountered: