I try to understand why this works
// .......................................................
var hero = {
name: 'Joni',
type: 'blond',
sayName: function() {
return this.name;
}
sayType: function() {
return this.type; }
}
document.write( hero.sayName()+ "</br>");
document.write( hero.sayType());
// .......................................................
but this doesn't works
// .......................................................
var hero = {
name: 'Joni',
type: 'blond',
sayName: function() {
return this.name;
}
sayType: function() {
return this.type;
}
}
document.write( hero.sayName()+ "</br>");
document.write( hero.sayType());
// .......................................................
thanks