add a default value to argument javascript code example
Example: javascript default function parameter value
function multiply(a, b) {
b = (typeof b !== 'undefined') ? b : 1
return a * b
}
function multiply(a, b) {
b = (typeof b !== 'undefined') ? b : 1
return a * b
}