define_property_str in js_sys::Reflect - Rust (original) (raw)

Skip to main content

js_sys0.3.91

In js_sys::Reflect

js_sys::Reflect

Function define_property_str

Source

pub fn define_property_str<T>(
    target: &Object<T>,
    property_key: &JsString,
    attributes: &PropertyDescriptor<T>,
) -> Result<bool, JsValue>

where
    Object<T>: ErasableGenericBorrow<Object<JsValue>>,
    PropertyDescriptor<T>: ErasableGenericBorrow<PropertyDescriptor<JsValue>>,

Expand description

The static Reflect.defineProperty() method is likeObject.defineProperty() but returns a Boolean.

MDN documentation