我想知道是否可以从原型对象返回多个值。我需要返回几个数组的值并在稍后调用它们。下面是我的代码示例。如果需要,我可以显示一个 JSFiddle。谢谢!
EmployeeObj.prototype.showEmployee = function(emPhoto0,emPhoto01){
var employeePhoto = new Array();
employeePhoto[emPhoto0] = new Image();
employeePhoto[emPhoto0].src = "pics/taylor.jpg";
employeePhoto[emPhoto01] = new Image();
employeePhoto[emPhoto01].src = "pics/roger.jpg";
var showPhoto1 = employeePhoto[emPhoto0];
var showPhoto2 = employeePhoto[emPhoto1];
return showPhoto1;
return showPhoto2;
};