js_sys::Reflect

Function get_own_property_descriptor

source
pub fn get_own_property_descriptor(
    target: &Object,
    property_key: &JsValue,
) -> Result<JsValue, JsValue>
Expand description

The static Reflect.getOwnPropertyDescriptor() method is similar to Object.getOwnPropertyDescriptor(). It returns a property descriptor of the given property if it exists on the object, undefined otherwise.

MDN documentation