Object.defineProperties()

문법

Object.defineProperties(obj, props)

인자

obj

속성을 변경할 오브젝트입니다.

props

An object whose own enumerable properties constitute descriptors for the properties to be defined or modified. Property descriptors present in objects come in two main flavors: data descriptors and accessor descriptors (see Object.defineProperty() for more details). Descriptors have the following keys:

configurable

true if and only if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.Defaults to false.

예시

Polyfill

Assuming a pristine execution environment with all names and properties referring to their initial values, Object.defineProperties is almost completely equivalent (note the comment in isCallable) to the following reimplementation in JavaScript: