How to set the value of an array from a function? The issue is because I've to change the value of the index before of be set with an variable value.
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");