I've created a function that loops through an objects members, and their arrays as a separate function to be used as a util. In this function I would like to use a parameter; let's call it **action**, that is a reference to another function that manipulates strings, in the arrays of the object members being looped.
For instance I override String, using String.prototype.functionThatDoesSomething, so I can use it in the loop: arrayOfStrings[i].functionThatDoesSomething().

How would I pass a function like that into the util function as an argument?

Something like this is what I am after:

```
objLoop(myObj, String.prototype.functionThatDoesSomething); 

function objLoop(obj, action) {
    var modData = {};
    var list = [];
    for (var key in obj) {
        list = obj[key];
        var i,
            n = list.length;
        for (i=0; i<n; i+=1) {
            list[i] = list[i].action(); // e.g. functionThatDoesSomething()
        }
        modData[key] = list;
    }
    return modData;
}

```