Enums help document intent. To create an enum-like structure in JavaScript, you can use the Object.freeze method.
Example:
const COLORS = {
red: "#CE0C0C",
green: "#00F0B5",
blue: "#26547C"
};
Object.freeze(COLORS);
console.log(COLORS.red); // #CE0C0C
See this discussion on Stack Overflow. For more discussion on Enums, see this thread. TypeScript supports Enums natively.