title: Add or update an array element
body: <p>I created an array like:</p>
  
  <pre><code>myarr: [ 
      { name:'London', population:'7000000' },
      { name:'Munich', population:'1000000' }
  ]
  </code></pre>
  
  <p>At some point I need to add some new elements to the array, but first I need to check if element with the same name already exists. If yes, the value must be updated. If no, the new element must be created and added. If the value in new element equals zero and the element exists, it must be removed from the array.</p>