What is a callback function?

前端 未结 21 2861
耶瑟儿~
耶瑟儿~ 2020-11-21 23:01

What is a callback function?

21条回答
  •  滥情空心
    2020-11-21 23:42

    A callback function is a function you specify to an existing function/method, to be invoked when an action is completed, requires additional processing, etc.

    In Javascript, or more specifically jQuery, for example, you can specify a callback argument to be called when an animation has finished.

    In PHP, the preg_replace_callback() function allows you to provide a function that will be called when the regular expression is matched, passing the string(s) matched as arguments.

提交回复
热议问题