How is a closure different from a callback?

前端 未结 9 1059
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 19:08

I asked a question about callbacks and arrived at another question (see comment). How is a closure different from a callback?

9条回答
  •  萌比男神i
    2020-12-07 19:38

    A callback depending on a context variable aka bound variables (== object state) will be a closure. It will be a pure function, otherwise, when it only takes free variables (== parameters).

提交回复
热议问题