
<script>
/*
* 手写bind方法
* */
Function.prototype.myBind = function (thisArg, ...args) {
return (...newArgs) => {
return this.call(thisArg, ...args, ...newArgs)
}
}
const obj = {
name: 'zs',
age: 18,
}
function fn (a, b, c) {
console.log(this)
console.log(a + b + c)
return a + b + c
}
const bindFunc = fn.myBind(obj, 1, 2)
const result = bindFunc(3)
console.log('返回值:', result)
</script>










![[杂谈]-快速了解LoRaWAN网络以及工作原理](https://img-blog.csdnimg.cn/753816894e0a43a7b71160c240e47b09.webp#pic_center)








