web_sys::console::assert_with_condition_and_data_1 function

Example

This function will print JsValue Struct to the console if the bool condition fails.


pub fn console_assert_with_condition_and_data_1() {
    let y=10u32;   
    let z=15u32; 
    //Assertion failed                                
    web_sys::console::assert_with_condition_and_data_1(z<y,&JsValue::from("Test: bool condition failed"));
} 
                                                                        

Function


                pub fn assert_with_condition_and_data_1(condition: bool, data_1: &JsValue)  
           

features/dependencies

Source Code