title: How to update a boolean value based on the value in array of objects?
body: <p>I have an array of objects as below, and only one object has userInfo value as &quot;true&quot; and I want to update another boolean value (globally declared) to true only for the object which has userInfo element.
  How to get this, please help.</p>
  <pre><code>dataList = [
      0: {name: &quot;User 1&quot;, value: &quot;value 1&quot;}  
      1: {name: &quot;User 2&quot;, value: &quot;value 2&quot;}
      2: {name: &quot;User 3&quot;, value: &quot;value 3&quot;}  
      3: {name: &quot;User 4&quot;, value: &quot;value 4&quot;}
      4: {name: &quot;User 5&quot;, value: &quot;value 5&quot;, userInfo: true}
  ]
  </code></pre>