-this키워드
function Car (brand, name, color) {
this.brand = brand;
this.name = name;
this.color = color;
}
Car.Prototype.drive = function() {
console.log(this.name + "운전");
}
let avante = new Car ('hyundai', 'avante', 'black');
avante.color;
avante.drive();
정말 자주본 예제를 예를들어보자.
여기서 portotype : 원형객체로 이해하고
constructor : 생성자 함수
this : 함수가 실행 될 때 나를 부른 곳의 값을? 실행시킴
proto 는 뭘까
-ES6의 class와 super
개념으 계속 찾아봤는데 계속써봐야 적응이되겠지만 지금 나의 것으로 받아들인 개념은
그냥 위에서 설명했던것들을 더 간단하게 줄여준것같다 어떻게 어떤식으로 줄였냐면
super키워드를 이용해 this를 연결시켜주어 메소드를 실행시키는 과정을 정의해 주는? 느낌이다
더 찾아보고 수정하겠습니다 허허