title: get object data , load 2 condition the same time
body: <pre><code>var id = "displayImage1";
  //my object 
  var json = {
    displayImage1: {
      object: "style1"
    },
    displayImage2: {
      object: "style2"
    },
    displayImage3: {
      object: "style3"
    }
  };
  
  function JsonLoad(_id){
      checkImgCanvas = _id;
      for (var i in json) {
      if(i === checkImgCanvas){
          alert("yes got it");
      }else{
          alert("not object found");
      }
      }
  
  }
  </code></pre>
  
  <p>i am using this function to check if any json object value match the id value , if yes load "yes got it" else load "not object found". i do get the match but it also load "not object found" 2 times , i have no idea why ? it should not load the else condition cause i have match in my json object.</p>
  
  <p>how do i make this function if match load "yes" if no load else condition.(load once)</p>
  
  <p><a href="https://jsfiddle.net/Tedeee/v7rjdkj6/" rel="nofollow">Demo</a> </p>