When writing sound code should i be using global objects or passing locals to functions and then returning the functions local object back to the original function?
function func1(obj) {
..modify obj
return obj;
}
object = func1(object)
..do something with modified object
or
var object={..};
function func1() {
..modifiy object
}
function func2() {
func1();
..do something with modified object
}
func2();
the first seems more readable, the second seems like better practice...