listofLOBs: function(data) { //passing data
var returnLOB = [];
console.log(data);
for (var i1r= 0; i1r < data.length; i1r++) {
var lob = new LOBslist();
lob.name = data[i1r].name;
lob.id = data[i1r].id;
returnLOB.push(lob); // storing in returnLOB
}
console.log(returnLOB[1].name);
$('#mainWrapper').find('select[name="lob-select"] option:selected').text(returnLOB[1].id); //using the returnLOB's object data to populate dropdown
return returnLOB;
}
In the above function i am storing objects in the returnLOB array and using it inside the function itself to populate a dropdown.
But say this is file1.js, i would like to access returnLOB's values from file2.js How can i do that? Thanks in advance.
Note: i have declared returnLOB[] globally too.(outside the above function)