title: Remove items in array with quantity 0 in React Native
body: <p>I want to remove the items in array that has quantity of zero. i tried:</p>
  
  <pre><code>    constructor(props) {
      super(props);
      this.state = {
      serviceAvailed: [{"label": "Top", "quantity": 2}, {"label": "Bottoms", "quantity": 0}, 
      {"label": "Jacket", "quantity": 1}, {"label": "Beddings", "quantity": 0}, {"label": "Shoes", 
      "quantity": 0}];,
      }
  </code></pre>
  
  <p>On component did mount i looped the items inside the array and called the method removeItem that is supposed to remove all the items that has zero quantity</p>
  
  <pre><code>   componentDidMount() {
      let {serviceAvailed  } = this.state;
      serviceAvailed = this.state.array.map((item, i) =&gt; {
      let quantity=parseInt(item.quantity);
         if(quantity&lt;1){
         this.removeItem(i)
         }});
     }
  </code></pre>
  
  <p>Function to remove the array</p>
  
  <pre><code>   removeItem(index) {
      const serviceAvailed = this.state.serviceAvailed;
      serviceAvailed.splice(index, 1);
      this.setState({ serviceAvailed });
      console.log(serviceAvailed)
     }
  </code></pre>
  
  <p>expected result:
  serviceAvailed: [{"label": "Top", "quantity": 2}, {"label": "Jacket", "quantity": 1}];,</p>