![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
前端
ReStart3213
这个作者很懒,什么都没留下…
展开
-
简单的JS实现随机点名
<!--CSS样式--><style> body{ background: #3c3c3c; } #con{ width: 800px; height: 400px; margin: 100px auto; } #con h1{ color: #fff...原创 2019-06-14 20:29:06 · 639 阅读 · 0 评论 -
自定义call方法
自定义call方法的实现:1、call方法调用函数2、传入实参3、改变this指向 Function.prototype.myCall=function (target) { var arr = []; for (var i = 1; i <arguments.length ; i++) { arr.push(argument...原创 2019-08-22 11:13:51 · 364 阅读 · 0 评论 -
自定义apply方法
自定义apply方法:和call方法类似,接受参数的方式不一样1、函数调用2、接受参数3、改变this指向Function.prototype.myApply=function(target,params){ target.__proto__.fn=this; target.fn(...params); delete target.__proto__.fn...原创 2019-08-22 11:40:42 · 218 阅读 · 0 评论 -
自定义bind方法
自定义bind方法:bind做了什么事1、传入参数2、返回一个新函数3、改变this指向Function.prototype.myBind=function(target){ const _this=this; let arr1 = []; for(let i = 1; i<arguments.length;i++){ ...原创 2019-08-22 16:24:30 · 349 阅读 · 0 评论