til 19

jeemk94·2023년 6월 13일
0

이번주 부터 노드를 본격적으로 배운다
자바스크립트 기반이라서 아직 이해안된 문법들이 많다
그래도 좀 이해가 가는것은 class 다
class User {
constructor(name, age, tech) { / constructor 라는 객체들을 각각 값에 배정을 해줄수있다
// User 클래스의 생성자
this.name = name;
this.age = age;
this.tech = tech;
}
}
const user = new User("이용우", 28, "Node.js"); // user 인스턴스 생성

console.log(user.name); // 이용우
console.log(user.age); // 28
console.log(user.tech); // Node

  super(name, age, tech); // 부모클래스를 불러온다 
profile
NOOBcording

0개의 댓글