const {function Name} = function code... 这个语法叫什么?

const {function Name} = function code... What is this syntax called?

我目前正在查看一些代码,开发人员编写了以下函数:

const {functionName} = ...some code...

我以前没见过这种语法。这种函数语法叫什么,有什么用?

这叫做解构赋值。

详情见https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment