title: Compare each element of the array to state with react
body: <p>Hi i dont't know how to compare each elements of the array to the state: </p>
  
  <p><a href="https://i.stack.imgur.com/UFc1I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UFc1I.png" alt="enter image description here"></a></p>
  
  <pre><code>doesCustomerExist = () =&gt; {
    const { customers } = this.props;
    let result = customers.map(c =&gt; c.phone)
    if(result === this.state.phone)
      return (console.log('already exist'))
      console.log(result)
  }
  </code></pre>