3 ms·
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
by throwaway3453 11y 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; }
- braythwayt 11y agoAs 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.