I am creating a custom event method, to do so I must create the event types as constants. My question is how to access a constant within an object.
Example:
var EventManager=function() {
const EVENT_ON_USER_LOGIN = "EVENT_ON_USER_LOGIN";
};
from the outside I want to access EVENT_ON_USER_LOGIN
.
Something like this:
var eventManager = new EventManager();
console.log(eventManager.EVENT_ON_USER_LOGIN );
I can not access it either
console.log(EventManager.EVENT_ON_USER_LOGIN );