関数から配列の値を設定する方法は? 問題は、変数値を設定する前にインデックスの値を変更する必要があるためです。
function foo(arr) {
this.arr=arr;
}
var f = new foo(['a', 'b', 'c']);
// I had thinked in use a function like this one
// Note thta I used index to pass an array wich could
// be greater than 1 dimension.
foo.prototype.setv = function(index, v) {
this.arr.index = v;
}
// but it does not works like I was expecting
idx = [1];
foo.setv(idx, "Z");