pop 从末尾删除
    shift 从前面删除

    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. // pop 从末尾删除
    11. // shift 从前面删除
    12. var arr = [1,2,3,4];
    13. arr.pop();//[1,2,3]
    14. arr.shift();//[2,3]
    15. console.log(arr)
    16. </script>
    17. </body>
    18. </html>

    1.PNG