'function call' 和 'callback function' 有什么区别?
what is the difference between a 'function call' and a 'callback function'?
函数调用
Per MDN, A function call is an expression that passes control and
arguments (if any) to a function and has the form: expression
(expression-listopt)
回调函数
A callback function is a lucky function that gets passed into the enclosing higher-order function: The callback function gets executed (called) inside the higher order function, but not necessarily immediately.
https://thenewstack.io/mastering-javascript-callbacks-bind-apply-call/
函数调用是与程序语法相关的术语。它通常与程序和编程语言有关。没有预定义的语义,只是用来描述程序的术语。
回调函数是与程序执行语义相关的术语。在某种callback function中是function call with scope,它作为参数传递给另一个函数或方法,回调函数的一些参数可以是自由变量和回调函数通常在传递它的方法或函数之后执行。
函数调用
Per MDN, A function call is an expression that passes control and arguments (if any) to a function and has the form: expression (expression-listopt)
回调函数
A callback function is a lucky function that gets passed into the enclosing higher-order function: The callback function gets executed (called) inside the higher order function, but not necessarily immediately. https://thenewstack.io/mastering-javascript-callbacks-bind-apply-call/
函数调用是与程序语法相关的术语。它通常与程序和编程语言有关。没有预定义的语义,只是用来描述程序的术语。
回调函数是与程序执行语义相关的术语。在某种callback function中是function call with scope,它作为参数传递给另一个函数或方法,回调函数的一些参数可以是自由变量和回调函数通常在传递它的方法或函数之后执行。