I have two objects and one array.
I have an array with values:
var a1 = ['case1','case2','case3'];
Then in another object, I work with the array by passing it in as context.
var obj2 = {
    init: function(context){
       for( var elem in context) {
          // do stuff with the elements
       }
    }
}
I also have another object that I pass the object into the same way.
var obj3 = {
    init: function(context){
       for( var elem in context) {
          // do stuff with the elements
       }
    }
}
Then I execute the init functions as such:
obj2.init(a1);
obj3.init(a1);
Another way I could do this would be as shown below, without passing the array in to the init function, and just referencing the array directly.
var obj2 = {
    init: function(){
       for( var elem in a1) {
          // do stuff with the elements and access directly to the obj1 array
       }
    }
}
var obj3 = {
    init: function(){
       for( var elem in a1) {
          // do stuff with the elements and access directly to the obj1 array
       }
    }
}
obj2.init();
obj3.init();
What affect would this have on my code?
 
     
    