title: return TRUE or FALSE from a function
body: <p>Here  i have a function .It accepts an array of object and a specific value.The array is iterated using a forEach method to ensure the provided value is already existed in any of the objects in the array.If found it returns FALSE ,or it should return true.But although it returns FALSE ,the rest of the code alse gets executed results in returning TRUE all the time.How i can return only FALSE/TRUE</p>
  
  <pre><code>   if(find_value_in_obj(all_selected,current.value)){
          all_selected.push({select_elem:current,value:current.value});
          console.log(all_selected);
      }else{
  
          alert("you already selected the value");   
      }
  
    function find_value_in_obj(arr_obj,value){
  
          arr_obj.forEach(function(elem,index,array){
  
              if(elem.value == value){
                  console.log('found it ');
                  return false;
              }
          });
          console.log("i am her"); // though value already exists and should returned ,it gets executed results in returning TRUE instead
  
          return true;
      }
  </code></pre>