Created
February 18, 2013 07:26
-
-
Save goonoo/4975654 to your computer and use it in GitHub Desktop.
설정 객체의 단점 중 매개변수의 이름을 기억해야 한다는 것 극복 + 기본값 부여 방법
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 addPerson (conf) { | |
var options = $.extend({ | |
username: null, | |
first: null, | |
last: null, | |
birthday: new Date(1970, 1, 1), | |
gender: "unknown" | |
}, conf); | |
// blah blah | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
우와~ 이런 거군요. :)