A Point constructor that creates Point objects. Replace all the x and y coordinate global variables with
Question:
A Point constructor that creates Point objects. Replace all the x and y coordinate global variables with Point objects. Update all the references to these variables in your code to now use the point objects. 4. Refactor the findMid function so that it is a method in the Point constructor. The method should now accept one Point object as a parameter. Let's look at an example usage of this method. Given the following two points: let p1 = new Point(0,250); let p2 = new Point(500,500); We will be able to call p1.findMid(p2); and it will return the midpoint between p1 and p2, as a Point object. 5. Update all the function calls to the findMid function to now use the method you created in the previous step. 6. a function called selectColor(). This function should check if the Randomize Colors checkbox is selected. If it is, return a random color. If it is not selected, return black.7. [1] Modify your executeProgram() function to fill the circle with whatever color is returned by calling the selectColor() function. 8. Setup a function that creates an interval such that every 100ms the executeProgram() function runs. 9. Setup the event handler so that when the 10 Rolls Per Second! button is clicked, the interval starts. Make sure that if the user presses this button multiple times, the interval does not run multiple times. 10. Set up the event handler so that when the Stop Rolling! button is clicked, the interval stops executing. 11. Set up an event handler so that pressing the space bar toggles on and off the interval
Uploaded is my version before these questions