Loading video...
Optional Parameters
- User-defined functions can be defined to allow for optional parameters . In order to define a parameter as optional, it must be assigned a default value in its function's definition.
- Default values must be constant values and can be of the following data types:
- Scalar (int, float, string, bool)
- Array
- NULL
- If a function has multiple optional parameters, not all optional parameters need to be supplied with argument values when calling the function.
- For any optional parameter you wish to provide a value, you must also provide values for all ‘prior’ optional parameters defined in the function’s parameter list. Any ‘later’ optional parameters do not have to be provided values.
- Additional Resources:
Optional Parameters
Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.


































Start Learning Now
Our free lessons will get you started (Flash® 10 required).
Sign up for Educator.comGet immediate access to our entire library.
Features Overview