Now see, I've only dipped my toes into the extremely divisive world of javascript, and not even all that much for game-dev, but this is a problem I understand. These kinds of problems, as weird as it is to say, are the ones I love solving, for some reason.
I used to make little adventure games in Visual Basic back in school, basically choose-your-own-adventure but with some tracked RPG stats as well, and it was basically entirely problem solving like this.
Sadly, the older I got, the more things I wanted to consider when making games like that - which meant different engines or languages, and complexity skyrocketed, so I ended up stopping.
Suffice to say, this brought back memories, somehow.