Determine if a JavaScript function is a bound function

前端 未结 7 1540
梦如初夏
梦如初夏 2020-12-14 16:51

Is there a way to determine if a JavaScript function is a bound function?

Example:

7条回答
  •  时光说笑
    2020-12-14 17:10

    You would need to write your own bind function on the prototype. That function would build an index of what has been bound.

    You could then have another function to perform a lookup against the object where that index is stored.

提交回复
热议问题