Function Declarations
๐จโ๐ผ You've created your first functions! Notice how you can call them multiple
times - that's the power of reusability.
๐ฆ Function declarations are "hoisted" in JavaScript, meaning you can call them
before they appear in the code:
greet() // This works!
function greet() {
console.log('Hello!')
}
This is different from other ways of defining functions (like function
expressions), which we'll see later.
Good function names are verbs that describe what the function does:
greet,
calculateTotal, validateEmail, fetchUser.