I am currently looking over some code and the developer wrote the following function:
const {functionName} = ...some code...
I haven't seen this type of syntax before. What is this type of function syntax called and what is it used for?
I am currently looking over some code and the developer wrote the following function:
const {functionName} = ...some code...
I haven't seen this type of syntax before. What is this type of function syntax called and what is it used for?
It is called Destructuring assignment.
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment for details.