setTimeout usually takes a function and a delay argument, but it can also accept more arguments that are passed to the given function. This can make code easier to read, at the cost of having yet another way of doing the same thing.

For example, the two statements below produce the same result:

setTimeout(() => console.log("hi, there!", 1234), 500);

setTimeout(console.log, 500, "hi, there!", 1234);
Final thoughts

I stumbled upon this when looking at an example for Promise.all(), which seemed weird at first, but then I remember I'm dealing with JavaScript and I shouldn't be surprised by anything anymore.

Previous on JavaScript
Mastodon Mastodon