Skip to content

Instantly share code, notes, and snippets.

@MikeGrace
Created July 14, 2010 17:52
Show Gist options
  • Save MikeGrace/475753 to your computer and use it in GitHub Desktop.
Save MikeGrace/475753 to your computer and use it in GitHub Desktop.
Faking default param passing in JavaScript function
function defaultParams(name, class, id) {
if (class == null) class = "CS 101 [default]";
if (id == null) id = "Not yet set";
return "Name: " + name + ", Class: " + class + ", ID: " + id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment