What is the difference between passing javascript function parameters in curly braces and not passing them in curly braces?

What"s the difference between passing parameters in curly braces and not passing in curly braces for the

javascript function? For example, the following code:

import CheckPermissions from "./CheckPermissions";
const Authorized = ({ children, authority, noMatch = null }) => {  //
  const childrenRender = typeof children === "undefined" ? null : children;
  return CheckPermissions(authority, childrenRender, noMatch);
};
The

problem is that the curly braces of the second line of code pass parameters, doesn"t it seem to work without curly braces? What"s the difference between using curly braces and not using curly braces?

Nov.26,2021

with curly braces means to pass a parameter, and the parameter type is an object. If there are three attributes children, authority, noMatch, without curly braces, you can pass three parameters. The curly braces here are either block-level scope or simply represent an object


.

this is the deconstruction syntax for es6

</a><br><br>

function createPlugin(data, { label, width ,height ... }) {

}

function updateSize(height, width ...) {

}
Menu