web_sys::console::assert_with_condition_and_data_0 function

Example

The assert_with_condition_and_data_0 function will print an "Assertion failed" message to the console if the bool condition fails.


pub fn console_assert_with_condition_and_data_0() {
     let y=10u32;   
     let z=15u32; 
     //Assertion failed                                
     web_sys::console::assert_with_condition_and_data_0(z<y); 
}
                                                         

Function


               pub fn assert_with_condition_and_data_0(condition: bool)  
           

features/dependencies

Source Code