title: Deleting the exact object in array when value is false
body: <p>My code looks like this:</p>
  
  <pre><code>var data = someDataWhichComesFromOtherMethod
  var array = [
      {name: "one", value:"data1", caption:"aaa"...},
      {name: "two", value:"data2", caption:"bbb"...},
      {name: "three", value:"data3", caption:"ccc"...},
      {name: "four", value:"data4", caption:"ddd"...}
      ...
  ]
  </code></pre>
  
  <p>What I want to do is to: first check if the <code>array</code> is not empty and later check if incoming <code>data</code> is true or not and when it's not, whole object needs to be deleted from the array.</p>
  
  <p>I started with:</p>
  
  <pre><code>if (array &amp;&amp; array.length) {
      //true
  } else {
      //false
  }
  </code></pre>
  
  <p>For example, if <code>data4</code> is <code>null</code> or <code>""</code>, <code>array</code> should look like this:</p>
  
  <pre><code>var array = [
      {name: "one", value:"data1", caption:"aaa"...},
      {name: "two", value:"data2", caption:"bbb"...},
      {name: "three", value:"data3", caption:"ccc"...}
      ...
  ]
  </code></pre>