How to make a javascript function that stops running after 20 seconds?

I am new to javascript and I am trying to write a function that will be executed after the user clicks the button and counts the number of times the user clicks on the images on the page and I want him to stop counting after 20 seconds, how do I make the function which will stop working after 20 seconds?

+4
source share

Source: https://habr.com/ru/post/1615837/


All Articles