The JavaScript here could become easier to maintain by following some of the suggestions of the ESLint tool. The rules not relevant to this project can be disabled in a `.eslintrc.json` file. I especially worry about the shadowing of the undefined keyword.