<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script>

    var arr = [1,3];
    //清空数组
//    console.log(arr);
//    arr.splice(0);
//    console.log(arr);

    //伪数组不能用。
//    console.log(arr);
//    arr.length = 0;
//    console.log(arr);

    //[]
//        console.log(arr);
//        arr = [];
//        console.log(arr);


</script>
</body>
</html>

  

相关文章:

  • 2022-03-06
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2021-05-11
  • 2022-02-09
  • 2022-02-11
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-26
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案