Javascript allows default parameter values
function func(apple="Apple") {return apple;}
Default parameters can be more complex, for example, a function can be call when a value is not given and the returned value will become the variable.
function func(apple=apples())
Things to keep in mind:
undefined