접근 제어자1 타입스크립트 클래스 클래스 자바스크립트의 클래스 소개 /** * 클래스 */ let studentA = { name: "이정환", grade: "A+", age: 27, study() { console.log("열심히 공부 함"); }, introduce() { console.log("안녕하세요!"); }, }; class Student { // 필드 name; grade; age; // 생성자 constructor(name, grade, age) { this.name = name; this.grade = grade; this.age = age; } // 메서드 study() { console.log("열심히 공부 함"); } introduce() { console.log(`안녕하세요! ${this.name}입니다!`); .. 2023. 10. 23. 이전 1 다음