set default argument value for angularjs function code example Example: javascript default parameters function multiply(a, b = 1) { return a * b; }