사전 숙지해야할 것

Constructor Function

생성자 함수

function Person(name, familyName){
	this.name = name;
	this.familyName = familyName;
}

const dahye = new Person("Dahye", "Shin");
console.log(dahye);
//Person { name: 'Dahye', familyName: 'Shin' }

Javascript에서 Objects 생성 방법

// 일반적인 객체 생성 방법
{
    const obj = {};
    const arr = [];
    const func = function () {};
}
//내장된 생성자 함수로 객체 생성
{
    const obj = new Object();
    const arr = new Array();
    const func = new Function();
}
//=> 두 코드는 동일하며, 내부적으로 생성자 함수를 이용하여 만든다.

모든 function은 prototype을 가지고 있다.