The setTimeout
function accepts optional arguments that are passed to the provided function. This way you can pass arguments without wrapping the actual function in another function.
// Instead of this...
setTimeout(() => search("hello", "world"), 1000);
// ... you can do this
setTimeout(search, 1000, "hello", "world");