Javascript – How to execute a setInterval function every time a key is pressed and stop when a key is not pressed in JS?
I need to execute a setInterval function only when a specific key (F in this case) is being pressed, and then clear it when the key is not pressed. So far, I have tried this: var process; function func(){ console.log('just…