web_sys::console::assert_with_condition_and_data function

Example

A false assertion prints an array of objects to the console without interrupting execution of subsequent code. The string representations of each of these objects are appended together in the order listed and output.


pub fn console_assert_with_condition_and_data() {
     let x=5u32;
     let y=10u32;   
     let z=15u32; 
     let array = js_sys::Array::new();
     array.push(&"Assertion Failed".into());
     //Assertion passed                                
     web_sys::console::assert_with_condition_and_data(x<y,&array);
     //Assertion failed                                
     web_sys::console::assert_with_condition_and_data(z<y,&array); 
}                              
               

Function


               pub fn assert_with_condition_and_data(condition: bool, data: &Array)
          
features/dependencies

Source Code