title: How to add key and Value if the array key does not exists in Javascript
body: <p>I want to create a dictionary in JavaScript by checking for the objects property.</p>
  
  <pre><code>   var item = {};
     if(item.hasOwnProperty("xyz")){
         //do wat is required
     }else{
         //add the key property to the item object
     }
  </code></pre>
  
  <p>How to add this "xyz" key property to the object is my question.</p>
  
  <p>Thanks</p>