look at this documentation:
it explains the two ways we can declare functions: Function expressions and Function declarations
You can read about them.
const variableName = () = > is a function expression, where as
function variableName(n) is a function declaration. When to use which, is up to the developer. Learn there differences