📜  复制数组 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:05.054000             🧑  作者: Mango

代码示例3
// Copy an array
fn main() {
    let arr = ["a","b","c"];
    let mut another = arr.clone();  // make a copy
    println!("copy of arr = {:?} ", another);
    another[1] = "d";          // make a change
    assert_eq!(arr, another);  // panic, no longer equal
}