Completion requirements
View
5. Summary and Referencess
Summary
- Functions are essential components of scripts. There are native and custom functions that we can readily call out when needed in any part of the script.
- Custom functions can be created using either function by declaration method or function as an expression.
- Functions are basically composed of (1) a function name, which is usually representative of the operation expected to be performed by the function, (2) followed by open and close parentheses that contain optional arguments, otherwise just empty, and (3) executable codes enclosed in curly brackets.
- Functions may be called out and used anytime within the script. Furthermore, they can be edited or customized as needed, changing or setting the arguments, providing necessary data to the function. The function’s basic logic will still be used as is, only with different data at specific instances.
References
JavaScript Functions. (n.d.). Retrieved from W3Schools: https://www.w3schools.com/js/js_functions.asp.
Function Expressions. (n.d.). Retrieved from MDN Web Docs https://developer.mozilla.org/en-US/docs/web/JavaScript/Reference/Operators/function
Robbins, J.N. (2012). Learning Web Design (Fourth Edition).O'Reilly Media, Inc.