I have a constructor called timer with function methods inside of it. the start method inside of the timer constructor is an immediately invoked function and it is activating when I make my new object (sessionCountdown) to assign timer to, but I don’t want it to activate immediately when I assign timer to sessionCountdown, I want it to activate when I call sessionCountdown.start(3), something like that. I tried wrapping the start method inside a function earlier, but then when I called it like timer.start(2) it wasn’t working so I left it as an immediately invoked function.
The new object I made to assign timer to is sessionCountdown, but I don’t want the start method to activate when I assign sessionCountdown to the timer constructor, I will appreciate any help with how to do this.
here are links to my code : https://pastebin.com/PVuv0fky https://codepen.io/icewizard/pen/KQaGJe?editors=0000