Hacker News new | ask | show | jobs
by throwaway3453 3939 days ago
What you have written is a function statement rather than a function expression.

This is possible, but has no utility beyond the original.

    const diameter = function diameter (r) { return 2 * PI * r; }
1 comments

As other comments have noted, I a speaking to the fact that you can’t make a function declaration while also specifying that the name is not to be re-bound within its scope.

A function expression bound to a constant block-scoped variable does not have the exact same semantics.