I am bit new to object oriented programming using javascript.
I have an array of workspace as
//global var
var workspaceArray = new Array();
then I am pushing a workspace object in the array as -
//in some function
workspaceArray.push(new wsObj());
//wsObj function
function wsObj(){
states = new Array();
links = new Array();
}
But when I try to use it somewhere it throws error that cannot read property state.
//error in the following line
var stateName = "q" + "<sub>" + workspaceArray[activeWSId].states.length + "</sub>";
Thanks in advance.