When writing a callback, when is best to have the callback return a value, and when is it best to have the callback modify a parameter? Is there a difference?
For example, if we havewanted to grab a method named GetDependencies()list of dependencies, when would you do this:
function GetDependencies(){
return [{"Dep1" : 1.1},
{"Dept2": 1.2},
{"Dep3" : 1.3}];
}
And when would you do this?
function GetDependenciesRegisterDependencies(register){
register.add("Dep1", 1.1);
register.add("Dep2", 1.2);
register.add("Dep3", 1.3);
}