<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>arr_slice3</title> </head> <body> <script> var arr = [[1],[2],[3],[4],[5]]; var arr2 = arr.slice(0,10); console.log(arr2); // [[1],[2],[3],[4],[5]] console.log(arr2.concat(arr.slice(-1))); // [[1],[2],[3],[4],[5],[5]] </script> </body> </html>
js arr_slice3.html
最新推荐文章于 2023-03-06 13:40:43 发布