const func = ({ param1, param2 }) => {
//do stuff
}
It is destructuring, but contained within the parameters. The equivalent without the destructuring would be:
const func = o => {
var param1 = o.param1;
var param2 = o.param2;
//do stuff
}
It is basically shorthand for
{param1: param1, param2: param2}
No comments:
Post a Comment