title: Getting undefined setting object's property value using this in javascript
body: <p>I was trying to set <code>fullname</code> property of the object <code>person</code> using <code>this</code>, but got undefined when logging out the full name. </p>
  
  <pre><code>var person = {
    name:'yask',
    fullname: this.name + ' Srivastava'
  }
  
  console.log(person.fullname);
  </code></pre>
  
  <p>This is strange, as using <code>this</code> while using inside the function refers to the object. Here it looks like it's being referred to global object.(Window maybe..?)</p>