Step 1:
What are Functions?
Functions are reusable code blocks designed for particular tasks.
Functions are executed when they are called or invoked
Functions are fundamental in all programming languages.
Step 2:
Calling Functions:
Functions are executed when they are called or invoked
You call a function by adding parentheses to its name: name().
Step 3:
Function Parameters:
Parameters allow you to send values to a function.
Parameters are listed in parentheses in the function definition.
Step 4:
Function Return Values:
A function can return a value back to the code that called it.
The return statement is used to return a value from a function.
Step 5:
Function Arguments:
Function parameters and arguments are distinct concepts.
Parameters are the names listed in the function definition.
Arguments are the values received by the function.
Step 6:
Function Expressions:
A function expression is a function stored in a variable
The variable name can be used to call the function.
Step 7:
Arrow Functions:
Arrow Functions is a short syntax for function expressions.
You can skip the function keyword.
You can skip the return keyword.
You can skip the curly brackets.
For Example:

Top comments (0)