Functions
1. Defining and Calling Functions
function functionName(parameters) {
// code to be executed
}function greet() {
console.log("Hello, World!");
}
greet(); // Calling the function2. Parameters and Arguments
function greet(name) {
console.log("Hello, " + name + "!");
}
greet("Alice"); // "Hello, Alice!"
greet("Bob"); // "Hello, Bob!"3. Return Values
4. Function Expressions
5. Arrow Functions
Help us improve the content 🤩
Last updated