const fruit = { name = 'apple', season = 'fall'};
if(!new.taget){
return new User(name);
만약 new.taget이 false 값이라면(new가 안붙여있다면), 그것을 new User(name)으로 바꿔 반환해라. 라는 뜻
응용
지정된 프로토타입 객체 및 속성(property)을 갖는 새 객체를 만듭니다.
const fruit = Object.create(Object.prototype, {
name: { value: 'apple',
writable: true,
enumerable: true,
configuragle: true
},
season: {
value: 'fall',
writable: true,
enumerable: true,
configuragle: true
}
});
writable 덮어쓸 수 있는지
false일 경우 다른 value로 덮어 쓸 수 없음
enumerable 열거할 수 있는지
for in 으로 열거 시 가능 불가능
configuragle 객체 서술자를 수성할 수 있는지