A function declaration defines a named function. The function can be called before it is defined due to hoisting.
function functionName(parameters) {
// Function body
}
function greet(name) {
return `Hello, ${name}!`;
}
// Calling the function
console.log(greet('Prathamesh')); // Output: Hello, Prathamesh!