打赏

lodash 数组裁剪 drop

_.drop(array, [n=1])

裁剪数组中的前 N 个数组,返回剩余的部分。

<!DOCTYPE html>
<html lang="zh">

    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <title>数组裁剪</title>
    </head>

    <body>
        <script src="https://cdn.bootcss.com/lodash.js/4.17.10/lodash.min.js"></script>
        <script type="text/javascript">
            var aa = _.drop([1, 2, 3], 2);;
            console.log(aa);
            //[3]
        </script>
    </body>

</html>

 

posted @ 2018-06-21 16:42  孟繁贵  阅读(1072)  评论(0编辑  收藏  举报
TOP