javascript - Defining and calling function in one step - Stack Overflow

PHOTO EMBED

Sat Feb 11 2023 19:27:55 GMT+0000 (Coordinated Universal Time)

Saved by @bunny #javascript

> (function fac (n) {
    return (n === 0 ? 1 : n*fac(n-1));
  })(10)
3628800
content_copyCOPY

https://stackoverflow.com/questions/7498361/defining-and-calling-function-in-one-step