I recently started learning and using JavaScript with Node.js. One of the things I noted, in different tutorials and also in production code, is that there are lots of hardcoded strings. For example: https://www.tutorialspoint.com/nodejs/nodejs_event_emitter.htm
Same applies for production code - using strings for eventNames, property name, different status values, etc. It makes it harder to follow through existing code. Is there any good reason not to use patterns like this for example?
var Events = {GoodEvent: 'goodEvent', BadEvent: 'badEvent'};
myObject.on(Events.GoodEvent, func)