Javascript jquery: call function with parameters after timeout?

How can I call a function like this with parameters applied to it?

searchTimer = setTimeout(doSearch, 250); function doSearch(parameter) { } 
+4
source share
1 answer

Use anonymous function as a shell:

 searchTimer = setTimeout(function () { doSearch('parameter'); }, 250); 
+12
source

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


All Articles