I have written a javascript prototype function, in which i need to get value by passing variable like below
myarr.value(1,2)="Content";
myarr.prototype.value = function (rows,columns){
console.log(rows,columns);
}
In the above function I'm getting rows and columns as 1 & 2, but getting error msg "invalid assignment left-hand side" for the content.
Help me to get the content in this way? and mention what am i doing wrong here?
undefined = "Content". That's what your code does (assuming the first line is invoked on an object instance). There is no way this could work.myarr? A constructor ?myarr.value(1,2)="Content";you think should do?