consider the following code:
<script>
person={
firstname:"John",
lastname:function(){alert(this.firstname)}
}
person.lastname();
</script>
like local variables can be accessed from anywhere within the function ,to access the property of an object why should we use this keyword?Since we are within the object is the use of this keyword compulsory?