I have a student who wants to use a timer in their app. So they have made a while loop that counts seconds up to a 2 minute limit. But at the same time they want to be able to handle events such as the clicking of a button. This doesn't work with the while loop. Is there a way to have a timer and still detect and handle events at the same time? Thanks in advance...

Hi...this code likely won't work very consistently in JavaScript and may cause the browser to crash. Because of how JavaScript works...it doesn't really like it if you write loops to block functionality. If you want a one-time delay before some code is executed you should check out setTimeout. For repeatedly executing some code on a timer you can check out the newly added timedLoop which can be found in the control tab. Here is an example from the documentation. var seconds = 0; time…