NATIVE

settings_applicationsObject  >   settings_applicationsReflect

NATIVE

Editing
  • account_tree
  • bug_report

booleanresultsetPrototypeOf(Objecttarget, Objectprototype)

Object.setPrototypeOf()와 동일하지만 불리언(boolean)으로 결과를 반환한다. 지정된 객체의 프로토타입을 설정한다.

구문

형식
Reflect.setPrototypeOf(target, prototype)

매개 변수

Objecttarget필수

프로토타입을 설정할 대상 객체를 지정한다.

Objectprototype필수

대상 객체에게 지정할 새로운 프로토타입 객체를 나타낸다. null일 수도 있다.

반환

booleanresult

지정된 객체에 새로운 프로토타입이 성공적으로 설정되었는지 여부를 나타내는 불리언(boolean)을 반환한다. 지정된 target 또는 prototype이 객체가 아닌 경우 TypeError 예외가 발생한다.

Exception

TypeError

동적 타입의 값이 흐름상 맞지 않는 자료형이라 연산을 할 수 없을 때 발생하는 오류를 다루는 객체이다.

버전 명세

ECMAScript 2024(15th Edition)
#sec-reflect.setprototypeof

지원 웹브라우저