객체(2)
-
프로토타입 객체(The Prototype Object)
HTML 삽입 미리보기할 수 없는 소스 The prototype object is simply an object that multiple other objects can refer to to get any information or functionality that they need. For our needs, each of our constructor functions will have a prototype that all their instances will be able to refer to. 프로토타입 객체는 필요한 정보나 기능을 얻기 위해 다른 여러 객체가 참조할 수 있는 객체입니다. 필요에 따라 각 생성자 함수에는 모든 인스턴스가 참조할 수 있는 프로토타입이 있습니다. So let's clar..
2023.05.09 -
생성자 함수와 this 키워드(Constructor Functions and keyword "this")
HTML 삽입 미리보기할 수 없는 소스 function User(firstName, lastName, age, gender) { this.firstName = firstName; this.lastName = lastName; this.age = age; this.gender = gender; } const user1 = new User('Jill', 'Smith', 33, 'female'); const user2 = new User('Bob', 'Smith', 24, 'male'); user1 and user2 are objects of the class User. user1과 user2는 User 클래스의 객체입니다. You might be wondering how all these properties..
2023.05.09