does jquery have an equivalent of dojo.hitch()?

前端 未结 7 1694
甜味超标
甜味超标 2021-02-07 07:24

Forgive my ignorance as I am not as familiar with jquery. Is there an equivalent to dojo.hitch()? It returns a function that is guaranteed to be executed in the given scope.

7条回答
  •  爱一瞬间的悲伤
    2021-02-07 08:13

    In my mind, hitch in Dojo is more complex,

    e.g.,

    function f(a,b,c){return a+b*c}
    var newF = hitch(null,f,1,undefined,3);
    newF(2) /*1+2*3*/
    

提交回复
热议问题