Constants
I thought consolidating constants was evil. Just two or three dozens of them were enough to become a huge headache for me. In Java, this practice is frowned upon. In JavaScript, it seemed alright.
The answer which received the bounty recommended the following:
// Warning: This answer was written in 2014. module.exports = Object.freeze({ MY_CONSTANT: 'some value', ANOTHER_CONSTANT: 'another value' }); It was my first time encountering Object.freeze, so I went to google for the difference between Object.
Continue reading "Constants"