title: How to check if the JSON Object array contains the value defined in an arrary or not?
body: <p>I have the following JSON data.</p>
  
  <pre><code>categories = [
      {catValue:1, catName: 'Arts, crafts, and collectibles'},
      {catValue:2, catName: 'Baby'},
      {catValue:3, catName: 'Beauty and fragrances'},
      {catValue:4, catName: 'Books and magazines'},
      {catValue:5, catName: 'Business to business'},
      {catValue:6, catName: 'Clothing, accessories, and shoes'},
      {catValue:7, catName: 'Antiques'},
      {catValue:8, catName: 'Art and craft supplies'},
      {catValue:9, catName: 'Art dealers and galleries'},
      {catValue:10, catName: 'Camera and photographic supplies'},
      {catValue:11, catName: 'Digital art'},
      {catValue:12, catName: 'Memorabilia'}
  ];
  
  var categoriesJson = JSON.stringify(categories);
  </code></pre>
  
  <p>And following array.</p>
  
  <pre><code>var mainCat = ['Arts, crafts, and collectibles', 'Baby' , 'Antiques']
  </code></pre>
  
  <p>While looping the JSON data I need to check if the Object value is listed in an array or not. If the yes do something else do another thing.</p>
  
  <p>For example </p>
  
  <pre><code>$.each(categoriesJson , function (key, value) {
      if(value.catName is in array) {
          //do something here 
      } else {
          //do something here
      }
  });
  </code></pre>
  
  <p>How can I achieve this? </p>