check array elements in json object
<p>I have an array:</p>

<pre><code>var arr = [20122, 20133, 20144, 20155, 20177];
</code></pre>

<p>And I have a JSON object:</p>

<pre><code>[{
    "ext": "20177",
    "name": "SIP\/20177-000001e8",
    "state": "Ringing"
}, {
    "ext": "20122",
    "name": "SIP\/20122-000001e7",
    "state": "Ringing"
}]
</code></pre>

<p>I need to check the array as an input and check if the array values exist or not in the <code>JSON</code> object.  </p>

<p>I tried like below:</p>

<pre><code>var arr = [20122, 20133, 20144, 20155, 20177];
jQuery.map(resp, function(obj) {
  if(jQuery.inArray(obj.ext,arr) == -1){
    //not exist
  }                     
})
</code></pre>

<p>But here JSON is the input. But I need the array as input.</p>