Last active
June 17, 2020 09:05
-
-
Save YounglanHong/71ebd360bc0321b9bb3bc138417619a3 to your computer and use it in GitHub Desktop.
This file contains 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
class Coffee { | |
// constructor로 객체 초기화 | |
constructor(menu, origin, roasting) { | |
this.menu = menu; | |
this.origin = origin; | |
this.roasting = roasting; | |
} | |
order() { | |
console.log(this.menu, "주문이 완료되었습니다") | |
} | |
} | |
// new 키워드로 생성된 인스턴스 | |
const coffee = new Coffee("latte", "Colombia", "Medium"); | |
console.log(coffee.menu, coffee.origin, coffee.roasting); | |
coffee.order(); | |
// 출력 | |
// latte Colombia Medium | |
// latte 주문이 완료되었습니다 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment