In JavaScript, everything is passed by value. It means that if you reassign a value for a given parameter in a function, you will not modify the value outside of the scope of the given function. Another important thing to understand, is how value to object references work: if you pass an object to a function, it is also by value that it is given, but if you access a property of this object, then the actual object will be modified outside of the function too, but NOT the value (that is to say, the value which is a reference to the object).
In the end you have to pass an object to your function and modify a property of it to make it persist outside.
function setToUpperCase(object, key) { object[key] = ('' + object[key]).toUpperCase(); return object[key]; }
And use it like this:
var holder = { word: 'blah' }; setToUpperCase(holder, 'word'); console.log(holder.word); // BLAH