var Person = {
firstName: 'Joe',
midName: 'Alan',
lastName: 'Dokes',
age: '35',
getFirstName: function() {
return this.firstName;
},
setFirstName: function(n) {
this.firstName = n;
}
}
<script>
Person.setFirstName('John');
document.getElementById('info').innerHTML =
Person.getFirstName();
</script>