You are here

Extending Functions

Sometimes, you have a function already programmed, and then you need a more refined function, that takes even more parameters. Refactoring? A pain in the ass. Thank god I finally learned how to circumvent that pain:

Make a new, more refined function:

function moreComplexFunction(parameter1, parameter2, parameter3) { //execute stuff }

Then replace the original code in the simple function, replacing the superfluous parameters with standard values: