title: Filling checkboxes with values from an array
body: <p>I have some checkboxes that I am getting the values into an array:</p>
  
  <pre><code>&lt;ul&gt;
      &lt;li&gt;&lt;input type="checkbox" name="daily[]" value="0"&gt;&lt;/li&gt;
      &lt;li&gt;&lt;input type="checkbox" name="daily[]" value="1"&gt;&lt;/li&gt;
      &lt;li&gt;&lt;input type="checkbox" name="daily[]" value="2"&gt;&lt;/li&gt;
      &lt;li&gt;&lt;input type="checkbox" name="daily[]" value="3"&gt;&lt;/li&gt;
      &lt;li&gt;&lt;input type="checkbox" name="daily[]" value="4"&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I am using this function to get the values into the array:</p>
  
  <pre><code>var days = $('input[name^='+daily+']:checked').map(function(){
    return parseInt($(this).val(),10);
  }).get();
  </code></pre>
  
  <p>This is working well..
  But now I want to do the inverse.. To fill an edit form, I want to check the checkboxes when having the array. How could I do that in a good way?</p>