DEV Community

Discussion on: Enums in JavaScript

Collapse
 
jonrandy profile image
Jon Randy 🎖️

Might be better to just do:

const checkAnswerType = type => answerTypeEnum.hasOwnProperty(type)
Enter fullscreen mode Exit fullscreen mode
Collapse
 
marcosmol204 profile image
Marcos Molina 👩🏽‍💻

Hi Jon,
Thank you for the comment, I am adding it to the post.
What do you think about the proposed solution ?