pinalbhatt
4/19/2014 - 11:44 AM

Javascript Function with default parameter value

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
   */
 }