To declare optional function parameters in JavaScript, there are two approaches: Using the Logical OR operator (‘||’) : In this approach, the optional parameter is Logically ORed with the default value within the body of the function. Note: The optional parameters should always come at the end on the parameter list.