![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
javascript
Lin Qinghu
学无止境!
展开
-
JavaScript 中的 call/apply/bind
call/apply/bind 相同: 都可用于替换函数中不正确的this 区别 call/apply: 什么是:调用一个函数,并临时替换其中的this为指定对象 何时使用:在调用函数时,需要临时替换this为指定对象时 如何: 要调用的函数.call(对象,参数值,….) 调用函数 替换函数中的this为指定"对象" 传入参数 如果参数值列表是一个数...原创 2018-10-12 14:59:01 · 171 阅读 · 0 评论 -
js中封装一些常用小方法
oddsRide = (arg) => { if (!arg) return; /*****/ if (arg.toString().indexOf('.') == 1) { if (arg.toString().split(".")[1].length > 3) { arg = parseFloat(arg).toFixed(2) } }...原创 2018-11-01 14:16:24 · 252 阅读 · 0 评论