实现



<body>
    <!-- 填写标签 -->
    <script type="text/javascript">
        // 填写JavaScript
        Array.prototype._filter = function(Fn) {
            if(typeof Fn !== 'function')return
            const newArr = []
            for(let i = 0;i < this.length;i++){
                 Fn(this[i])?newArr.push(this[i]):null
            }
            return newArr
}

    </script>
</body>

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务