Basically I'm not sure how we're going to represent difficulty yet in questions database. It'll either be an integer between 0 and 2, 0 meaning easy and 2 meaning hard or it'll be a string ("EASY", "MEDIUM" or "HARD")
So to abstract away the implementation detail, we need an enum to represent that difficulty.
Basically I'm not sure how we're going to represent difficulty yet in questions database. It'll either be an integer between 0 and 2, 0 meaning easy and 2 meaning hard or it'll be a string ("EASY", "MEDIUM" or "HARD")
So to abstract away the implementation detail, we need an enum to represent that difficulty.
It'll be something like:
difficulty = { EASY: valueForEasy, MEDIUM: valueForMedium, HARD: valueForHard }
That way we can use it something like:
const question = fetchQuestion()
if (question.difficulty === difficulty.EASY):
{ do stuff }
So we literally need a file with a Javascript Object in it. Put the file in the path
constants/difficulty.js