What is the difference between defining classed in the following ways?
1)
var parentCls = {
name:'John',
callMe : function (){
alert('Method gets called');
}
}
parentCls.callMe();
2)
function parentCls(){
this.name='John';
this.callMe = function (){
alert('Method gets called');
}
}
parentCls.CallMe()
Thanks