This is really confusing. I don’t have any error but I keep running into an issue where (even though I have no error) nothing happens when I click the button. But there is no issue. This is honestly a this issue because I understood the basics, but again, nothing is happening.
Your code just needs to be slightly refactored. Where this is going wrong is in your addEventListener. By default, when you call a function by name, the definition of this is changed to the element that it was called on, instead of on the Timer class.
To by pass this, just pass an arrow function to the addEventListener, which will keep the JS compiler from reassigning this to the button, and then call this.start().
You also need to have start and importantMethodCall inside of the Timer class if they are meant to be tracked along with the Timer class like.
this refers to the instance that gets created when creating a new object from the class. It also the new instance to have access to the methods and properties you define after the dot. You can learn more about this by reading some of these articles.
document.querySelector('#startButton') is the start button element. The second argument you pass to the class constructor is supposed to be this element. As far as the null, I am not really sure. If you have a pause button, then you would need to change the third argument from null to the actual pause button element.
I just put a null for no other reason than to satisfy the parameters since nothing was being done with the pauseButton yet in the code. It could have been anything really since there’s only an assignment to it in the constructor.
Then I need to go back and maybe even consider a new career because I’m not understanding why you re factored it like this lol.
Edit: Even though I very much appreciate both what you (Marcus & Randell) have been doing for me. I get some of this but I guess what I’m getting confused about is just how my brain learns. Which is up and down instead of a flowing easy logic topic on topic structure.