题解 | #Function.bind#

Function.bind

https://www.nowcoder.com/practice/ecad0164931847f78c55278cee56e544

<!DOCTYPE html>
<html>
    <head>
        <meta charset=utf-8>
    </head>
    <body>
    	
        <script type="text/javascript">
            // 补全代码
            Function.prototype._bind = function(target, ...arguments1) {
                if(typeof this !== "function"){
                    throw new TypeError("Error")
                }
                const fn = this
                return function Fn(){
                    return fn.apply(
                        this instanceof Fn ? this: target,
                        arguments1
                    )
                }
            }

            
        </script>
    </body>
</html>

全部评论

相关推荐

包行:平时怎么刷算法题的哇,字节的手撕听说都很难
字节跳动工作体验
点赞 评论 收藏
分享
职场水母:为啥你们整简历都喜欢整一大堆没用的,是期待让hr觉得很多,自己很厉害吗
0offer是寒冬太冷还...
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务