I'm pretty new to writing OO JS, but this has stumped me. So I setup me new Call object, then define what I assume to be empty arrays. When I call AddFieldQueryToArray() I get
Uncaught TypeError: Cannot call method 'push' of undefined
On this.fieldArray.push(field)
I don't really know why. I've tried this.fieldArray = fieldArray;
in the constructor too.
function Call()
{
var fieldArray = new Array();
var queryArray = new Array();
}
Call.prototype.AddFieldQuerysToArray = function(field,query)
{
if(field !== 'undefined')
{
this.fieldArray.push(field);
}
this.queryArray.push(query);
}