splice(index,howmany)
    index 从哪个下标开始
    howmany 删除多少个

    1. <!DOCTYPE html>
    2. <html lang="en">
    3. <head>
    4. <meta charset="UTF-8">
    5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
    6. <title>Document</title>
    7. </head>
    8. <body>
    9. <script>
    10. // splice(index,howmany)
    11. // index 从哪个下标开始
    12. // howmany 删除多少个
    13. var arr = [1,2,3,4,5]; //[1,2,3,5];
    14. arr.splice(3,1);
    15. console.log(arr);
    16. </script>
    17. </body>
    18. </html>

    1.PNG