I have a function to upload images and for now the imgs array is going to be global scope, but I wanted this function to return this array:
function loadImages () {
imgs = [];
for (var i in arguments) {
var start = arguments[i].lastIndexOf("/") + 1;
var end = arguments[i].indexOf(".");
var name = arguments[i].substring(start, end);
imgs[name] = new Image();
imgs[name].src = arguments[i];
}
}