2

I've refactored your code below to add some of the repetitive items into functions and tried to improve your variable names a little. The new variable names and function names should clearly indicate their intended purpose/data. A rule of thumb worth remembering is the concept of DRY (Do not Repeat Yourself). const createArraywithJsonData = function(...


1

Some issues: The constructor recognizes an error if the file doesn't exist but, after logging, just behaves as if nothing is wrong. It does not communicate back an error. Probably, you should just let the exception go back to the caller or don't test it at all in the constructor and let the operation that actually uses the file get the error and ...


1

If you had not written this code but were trying to use it, how would you know that the square on either side was a button or what the function of that button was? Buttons need labels and they are generally oval shaped. When you design or write code for the web you need to consider the user and how they will be using the tool. Even a toy application should ...


Only top voted, non community-wiki answers of a minimum length are eligible