It would be more convenient to have an object, because you can dynamically access properties:
var processLinkFunctions = {
about: function() { ... },
services: function() { ... }
};
Then it is as simple as:
processLinkFunctions[variableName]();
It is basically the same as processLinkFunctions.about()if variableName === "about".
source
share