How to check whether my key exists in array object
<pre><code>var arr = [{
   key: "key1", value: "z"
}, {
   key: "key2", value: "u"
}, {
   ...
}];
</code></pre>

<p>How to check whether my <code>key:"key1"</code> exists already or not. If it does not exist, i need to add the key in ma array. </p>

<pre><code>if(arr.hasOwnProperty("key1")){
      arr.unshift({key:"key1", value:"z"});
}
</code></pre>
