- By breaking down a large program into smaller, manageable functions, you can organize your code into meaningful units. Each function handles a specific task, making the code easier to understand and maintain.
- Declaring functions creates the function and stores the name of the function and the code block in memory.
- Once you have declared a function, you can execute the function throughout your program to run the same code and perform the same task.
- Well-named functions with a clear purpose can make the code more readable. Instead of having a complex block of code at a single place, you have smaller functions with descriptive names that explain what they do.
To "call" a function in JavaScript means to execute or invoke the function's code, allowing it to perform the tasks defined within its function body. When you call a function, you are telling the program to run the code that belongs to that particular function.
- Connect your js file to your HTML file
- Open your code in the browser and open your console
In the js
file, complete the list of exercises.