dmikester1 – 04-05 Dec 5

I'm working on the Advent of Code using Node and React. I have my React front end with a button to "Get Answer" which passes an id string. In the backend, I am writing a function for each puzzle. That id string will tell the backend which function to call. There are 2 puzzles per day and 25 days, that is 50 puzzles and thus 50 seperate functions. I would prefer not to write a gigantic if/else or switch statement to determine the correct function to run. Is there a way to dynamically call a function by name?
UU
Unknown User133d ago