filmov
tv
Introduction to Functions In Javascript

Показать описание
Today we go over a brief introduction to functions in javascript. We discuss how to create a function, how to call a function, and how to return a value from a function.
If you have any questions or comments, please comment below and I or someone from the community will try our best to answer you.
Reach me on other social media:
Video Description
Functions are the bread and butter of programming. They group sections of code into reusable components. They allow the programmer to perform actions multiple times without having to write the same commands multiple times or to create multiple variables for the same use case. They also help organize code so that it is easier to read and to manage.
By using functions to reduce code duplication, maintaining code is much easier as well. If you want to change the way the code handles some input or event, you can simple edit the single function instead of having to dig through multiple files trying to find all the times you were supposed to fix the issue.
Glossary
Function: A reusable piece of code stored in a variable.
Function Arguments: One or more values that can be given to a function. These values are stored in variables and usable throughout the scope of the function.
Invoke: To call, or run a function. When we invoke a function, we are asking the program to run whatever code is contained within that function.
Return: To end a block of code early. If a value is given (return value), that value will be used outside of the block. If a function returns a value, you can use it directly or assign that value to a variable: const newVariable = myFunction();
If you have any questions or comments, please comment below and I or someone from the community will try our best to answer you.
Reach me on other social media:
Video Description
Functions are the bread and butter of programming. They group sections of code into reusable components. They allow the programmer to perform actions multiple times without having to write the same commands multiple times or to create multiple variables for the same use case. They also help organize code so that it is easier to read and to manage.
By using functions to reduce code duplication, maintaining code is much easier as well. If you want to change the way the code handles some input or event, you can simple edit the single function instead of having to dig through multiple files trying to find all the times you were supposed to fix the issue.
Glossary
Function: A reusable piece of code stored in a variable.
Function Arguments: One or more values that can be given to a function. These values are stored in variables and usable throughout the scope of the function.
Invoke: To call, or run a function. When we invoke a function, we are asking the program to run whatever code is contained within that function.
Return: To end a block of code early. If a value is given (return value), that value will be used outside of the block. If a function returns a value, you can use it directly or assign that value to a variable: const newVariable = myFunction();