Javascript Function with default parameter value
function foo(age, isValid) { a = typeof a !== 'undefined' ? a : 18; b = typeof b !== 'undefined' ? b : false; /* rest function body here */ }