new 연산자와 생성자 함수

new - JavaScript | MDN

1. Syntax

new constructor
new constructor()
new constructor(arg1)
new constructor(arg1, arg2)
new constructor(arg1, arg2, /* …, */ argN)
function Car(make, model, year) {
	this.make = make;
	this.model = model;
	this.year = year;
}

const car1 = new Car('Eagle', 'Talon TSi', 1993);

console.log(car1.make);
// Expected output: "Eagle"

2. Description

2-0. new의 역할과 constructor

constructor functions

2-1. Adding a new property