{"size": 477, "ext": "js", "max_stars_repo_path": "intermediate_js/ch3_object-oriented_JS/objects_and_class/2_constructor_function/index.js", "max_stars_repo_name": "aspynlim/code_it", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "intermediate_js/ch3_object-oriented_JS/objects_and_class/2_constructor_function/index.js", "max_issues_repo_name": "aspynlim/code_it", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "intermediate_js/ch3_object-oriented_JS/objects_and_class/2_constructor_function/index.js", "max_forks_repo_name": "aspynlim/code_it", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 19.875, "max_line_length": 57, "alphanum_fraction": 0.6498951782}
// 1) 함수 이름 대문자로 생성
function User(nickname, birthDate) {
  this.nickname = nickname;
  this.birthDate = birthDate;
  this.buy = function(item){
    console.log(`${this.nickname} buys a ${item.name}.`);
  };
};

const item = {
  name: 'sweater',
  price: 30000
};


// 2) "new" 로 호출해야 함
const user1 = new User('Sam223', '2000-01-10');
const user2 = new User('Kim123', '1999-01-10');

console.log(user1.birthDate);
console.log(user2.birthDate);

user1.buy(item);
user2.buy(item);