Hi i am trying to get my head around some basic stuff in javascript, i want to create the equivalent to a class see below:
var myTest = {
myTester:"testing",
testCode:function(){
return myTester;
}
};
when i call alert(myTest.testCode()); i get error myTester is undefined;
i also have similar trouble when trying to set the value of myTester too, what i am trying to achieve here is something along the lines of this:
var myObj = myTest.testCode();
var tester = myObj.myTester;
as myObj is an object i should once created be able to access its values but i dont usually do javascript just jQuery and i am trying to create an application in pure javascript just for brain feed and would appreciate a little guidence, especially on what do you actually call this, is it a class????
thanks