title: How to get value from Multiple Checkbox to array in react?
body: <p>How to get multiple checkbox values to an array in react js? This is my dynamic destination places from API. I want post to Backend with an array.</p>
  
  <pre><code>{
    this.state.destination.length &gt; 0 ? (
      this.state.destination.map((destination, index) =&gt; (
        &lt;div className="col-md-3"&gt;
          &lt;div class="pretty p-default"&gt;
            &lt;input type="checkbox" name="dest" value={index} onClick={event =&gt; this.handleDestination(event)} /&gt;
            &lt;div class="state p-primary"&gt;
              &lt;label&gt;{destination.dest_name}&lt;/label&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      ))
    ) : (
      &lt;div&gt;
        &lt;label&gt;
          &lt;b&gt;No results found ! &lt;/b&gt;{' '}
        &lt;/label&gt;
      &lt;/div&gt;
    );
  }
  
  
  
  handleDestination(event) {
  
      const options=this.state.options
      let index
      if(event.target.checked){
        options.push(+event.target.value)
      }
      else{
        index=options.indexOf(+event.target.value)
        options.splice(index,1)
      }
      this.setState({ options:options})
  
  }
  </code></pre>