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

Skip to main content

js_sys0.3.91

In js_sys::Reflect

js_sys::Reflect

Function get_str

Source

pub fn get_str<T>(
    target: &Object<T>,
    key: &JsString,
) -> Result<Option<T>, JsValue>

where
    Object<T>: ErasableGenericBorrow<Object<JsValue>>,
    Option<T>: ErasableGenericOwn<Option<JsValue>>,

Expand description

The static Reflect.get() method works like getting a property from an object (target[propertyKey]) as a function.

MDN documentation