Home > Article > Web Front-end > JavaScript function parameters use the method with parameter name to assign the incoming method_javascript skills
The example in this article describes the method of assigning and passing in JavaScript function parameters with parameter names. Share it with everyone for your reference. The specific analysis is as follows:
Here is actually when passing parameters to a function, you can use parameter name: parameter value to pass, so that you will not pass the error. However, the following code is implemented through a dictionary, unlike python which supports such a method
function foo({ name:name, project:project}) { Print( project ); Print( name ); }
Call method
foo({ name:'soubok', project:'jslibs' }) foo({ project:'jslibs', name:'soubok'})
I hope this article will be helpful to everyone’s JavaScript programming design.