function greet() {
console.log('Salut!');
}
greet();The declaration defines the behavior; greet() executes it once.
LESSON 27 OF 50
Group behavior in a reusable function.
A function declaration binds a name to a statement body. The body runs when the function is called by its name followed by parentheses.
function greet() {
console.log('Salut!');
}
greet();The declaration defines the behavior; greet() executes it once.
function greet() { console.log('Salut!'); }The function is defined, but without a call its body does not run and there is no output.
Declare a greet function that prints “Salut!”, then call it once.
Run the code to see the result.The function name separates defining the behavior from the moment it executes.
ANALYSIS REQUEST
The initial discussion is without obligation. You receive an honest recommendation, suitable stages and the factors that affect price.