Created
April 19, 2014 11:44
-
-
Save pinalbhatt/11082031 to your computer and use it in GitHub Desktop.
Javascript Function with default parameter value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo(age, isValid) | |
{ | |
a = typeof a !== 'undefined' ? a : 18; | |
b = typeof b !== 'undefined' ? b : false; | |
/* | |
rest function body here | |
*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment