When a function has many parameters and assuming that the project has a large amount of work, the programmer must remember the nature and sequence of the function's parameter list accurately, this is difficult. In order to facilitate every call to a function, we do not need to repeatedly search for documents, we can allow parameters to be passed in any order by name/key value. I think this will save a lot of effort for our programmers.
To implement this method, we define the function parameters as objects. Then, we can expect users to pass an object that defines the required name/key value, this is easy to operate, saving us a lot of trouble or confusion.
1 function girl (a, B, c, d)
2 {
3 // code
4}
5 function boy (obj)
6 {
7 girl (obj. a, obj. B, obj. c, obj. d );
8 // code
9}
10 var Ellen = ["Ellen", 23, "mm", 54];
11 var home = new Array [4];
12 var mm = {a: Ellen; B: home; c: 1; d: 11 };
13 boy (mm );
This will streamline a lot of our work and improve our work efficiency.