function MyObject(){
this.name = "myObject";
this.type = "class";
this.methodA = function(){
alert(this.name);
}
this.methodB = function(){
return this.type;
}
}
var myObject = new MyObject();
myObject.methodA();
var type = myObject.methodB();
alert(type);