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; }