title: Want to return true or false when finding an exact match in an array of objects?
body: <p>I have a posList that contains an array of objects. I want to check if the entered value is an exact match of all the posCode in each object of the posList. My RegExp returns true when its a search match. For example, when 4325
  is entered it returns true. I only want it to return true if the match is exact. </p>
  
  <pre><code>//short example
  posList = [
      {
          posCode: "43252",
          description: "hi"
      },
      {
          posCode: "HTD632",
          description: "hello"
      }
  ]
  
  checkPosCodeUnique = () =&gt; {
      const re = new RegExp(_.escapeRegExp(this.state.posCode), 'i');
      const isMatch = result =&gt; (re.test(result.posCode));
      const list = _.filter(this.state.posList, isMatch);
      if (list.length &gt; 0) {
          error=true;
      }
  
  };
  </code></pre>