/ Published in: JavaScript
By not being limited to provide certain arguments/parameters in right order when calling a function, makes the function more versatile and easier to extend without breaking old code (e.g. calls to the function).
One solution is to pass an associative array holding the parameters.
Advantage: argument order is unnecessary, each argument have a label - easier to remember.
One solution is to pass an associative array holding the parameters.
Advantage: argument order is unnecessary, each argument have a label - easier to remember.