Skip to main content

define_property_str

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>> + EncodeTypeDef, for<'__wry_bindgen> &'__wry_bindgen Object<T>: BinaryEncode, PropertyDescriptor<T>: ErasableGenericBorrow<PropertyDescriptor<JsValue>> + EncodeTypeDef, for<'__wry_bindgen> &'__wry_bindgen PropertyDescriptor<T>: BinaryEncode,
Expand description

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

MDN documentation