4 ms·
JavaScript has named parameters, in sort of the same way that C has named parameters. Get used to writing your functions using objects for the arguments: fu
by gavinray 3y ago
JavaScript has named parameters, in sort of the same way that C has named parameters.
Get used to writing your functions using objects for the arguments:
function myFunc({ foo, bar }) {}
Then you can call
function myFunc({ foo: 1, bar: "x" })
Similarly in C/C++
struct MyFuncArgs { int foo; char bar; };
void myFunc(MyFuncArgs args) {}
myFunc({ .foo = 1, .bar = 'x' });