Why do we use additional parentheses here?

I do not understand why do we use parentheses here, if we have already used syntax of setTimeout?

codecademy.com/paths/web-development/tracks/webdev-intermediate-javascript/modules/javascript-promises/lessons/promises/exercises/settimeout

image

setTimeout expects a function as first argument.

normally then syntax would of an arrow function would be:

const x = () => {}

but given we don’t need to store the function in a variable, we can get rid of the const x = bit

1 Like

thank you for explanation))

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.