js_sys::Array::new function

Example

Creates a new empty array.


pub fn array_new() {
    let arr = js_sys::Array::new();
    array.push(&"Item 1".into());
    array.push(&"Item 2".into());
    array.push(&"Item 3".into());
    web_sys::console::log(&arr);
}                    
                

Function


               pub fn new() -> Array
           

features/dependencies

Source Code