wasm_bindgen::JsValue::from_str function

Example

Creates a new JSValue representing a string.


pub fn jsvalue_from_str() {
    let js_str=JsValue::from_str(&"Hello World");
    web_sys::console::log_2(&"Get Value:%s".into(),&js_str);
}
                                    

Function


        pub fn from_str(s: &str) -> JsValue
           

features/dependencies

Source Code