title: How to check if a value exists in AJAX success response
body: <p>I have an AJAX.</p>
  
  <pre><code>   var id = "some_text";
     $.ajax({
          type        : "GET",  
          dataType    : "json",
          url         : "&lt;?php echo site_url('con_atk/get_outlet'); ?&gt;",  
          async       : false,
          success     : function(outlet){
  
             $.map(outlet, function (v) { 
  
                if(v.NamaOutlet == id){
                  window.location.href = "page_a.php";
                }
                else{
                  window.location.href = "page_b.php"; 
                }
  
             })
          }   
  })
  </code></pre>
  
  <p>I'd like to check if the value of <code>id</code> is exist in the AJAX success call (JSON object type). If it exists, redirect to page A and if not redirect to page B. When I use <code>alert</code> on <code>v.NamaOutlet</code> the value is exist. But why am I not redirected to page_a.php?</p>
  
  <p><strong>edit</strong></p>
  
  <p>when I use <code>alert(JSON.stringify(outlet))</code>;</p>
  
  <pre><code>[{"KodeOutlet_iBSM":"ACG","NamaOutlet":"Accounting"},{"KodeOutlet_iBSM":"BBG","NamaOutlet":"Business Banking"},{"KodeOutlet_iBSM":"CB I","NamaOutlet":"Corporate Banking I"},{"KodeOutlet_iBSM":"CB II","NamaOutlet":"Corporate Banking II"},{"KodeOutlet_iBSM":"CBT","NamaOutlet":"Corporate &amp; Branch Transformation"},{"KodeOutlet_iBSM":"CCG","NamaOutlet":"Culture &amp; Customer Care"},{"KodeOutlet_iBSM":"CHG","NamaOutlet":"Consumer Finance &amp; Hajj"},{"KodeOutlet_iBSM":"CMG","NamaOutlet":"Commercial Banking"}
  </code></pre>