title: Typescript : Check if object exist in array by value
body: <p>I have this data:</p>
  
  <pre><code>roles = [
  {roleId: "69801", role: "ADMIN"}
  {roleId: "69806", role: "SUPER_ADMIN"}
  {roleId: "69805", role: "RB"}
  {roleId: "69804", role: "PILOTE"}
  {roleId: "69808", role: "VENDEUR"}
  {roleId: "69807", role: "SUPER_RB"}
  ]
  </code></pre>
  
  <p>i have to filter my table to check if there is an object containing a specifie value of role .</p>
  
  <p>My function should look like this :</p>
  
  <pre><code>checkRoleExistence(role){
  
  // if role exists on one of the objects return true
  // else returne false
  }
  </code></pre>
  
  <p>to use it i would do s.th like this :</p>
  
  <pre><code>let ifExists = this.checkRoleExistence("PILOTE") ;
  </code></pre>
  
  <p>I would like to use the <strong>"filter"</strong> function of <strong>Ecmascript</strong> .</p>
  
  <p><strong>Suggestions ?</strong></p>