클래스 다형성
-
javaScript 클래스(+ 프로퍼티 getter와 setter / 상속)Front/js 2024. 7. 4. 17:08
▤ 목차">HTML 삽입미리보기할 수 없는 소스 함수형 프로그래밍 언어인 javascript에서 최근 클래스의 개념이 나왔다.java에서 클래스와는 차이가 있다. 그 차이를 위주로 정리해보려고한다.java가 익숙한 사람은 java와 비슷한 부분이 있기에 금방 익숙해 질 수 있다고 개인적으로 생각한다. ✔ 클래스클래스는 OOP에서 특정 객체를 생성하기 위해 멤버를 정의하는 일종의 틀(설계도)을 말한다.기존의 PROTOTYPE을 기반으로 객체를 생성하는 것보다 명료하게 객체 작성이 가능하다.클래스도 함수와 같이 호출하기 전까지는 코드가 실행되지 않는다. ⌨ 형식class 클래스명{ 멤버 변수; constructor(){} // 생성자 메소드명(){}; //메서드} JAVA와 비교..