title: Bootstrap-Multiselect: why this string of comma separated values is not working as array after conversion
body: <p>I want to make array from string and then pass to multiselect to <code>select</code>options having these values in array.</p>
  
  <p>I tried the following code and it did not work:</p>
  
  <pre><code>var str =  "MAR ,APR, MAY ,JUN";
  var a = (new Function("return [" +str+ "];")());
  $('#example-optionClass').multiselect('select', a );
  </code></pre>
  
  <p>above code shows error: <code>ReferenceError: MAR is not defined</code></p>
  
  <p>Here is my source code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;title&gt;Bootstrap Example&lt;/title&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    &lt;link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"&gt;&lt;/script&gt;
    &lt;!-- Include the plugin's CSS and JS: --&gt;
  &lt;script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/js/bootstrap-multiselect.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/css/bootstrap-multiselect.css" type="text/css"/&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $('#example-optionClass').multiselect({
              includeSelectAllOption: true, // add select all option as usual
              optionClass: function(element) {
                  var value = $(element).val();
   
                  if (value%2 == 0) {
                      return 'odd'; // reversed
                  }
                  else {
                      return 'even'; // reversed
                  }
              }
          });
      });
  &lt;/script&gt;
  &lt;style type="text/css"&gt;
      #example-optionClass-container .multiselect-container li.odd {
          background: #eeeeee;
      }
      #example-optionClass-container .multiselect-all {
         background: #eeeeee;
      }
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="container"&gt;
    &lt;h2&gt;Bootstrap Multiselect Test&lt;/h2&gt;  
    &lt;div id="example-optionClass-container"&gt;
      &lt;select id="example-optionClass" multiple="multiple"&gt;
       &lt;option value="JAN"&gt;January&lt;/option&gt;
    &lt;option value="FEB"&gt;February&lt;/option&gt;
    &lt;option value="MAR"&gt;March&lt;/option&gt;
    &lt;option value="APR"&gt;April&lt;/option&gt;
    &lt;option value="MAY"&gt;May&lt;/option&gt;
    &lt;option value="JUN"&gt;June&lt;/option&gt;
    &lt;option value="JUL"&gt;July&lt;/option&gt;
    &lt;option value="AUG"&gt;August&lt;/option&gt;
    &lt;option value="SEP"&gt;September&lt;/option&gt;
    &lt;option value="OCT"&gt;October&lt;/option&gt;
    &lt;option value="NOV"&gt;November&lt;/option&gt;
    &lt;option value="DEC"&gt;December&lt;/option&gt;  
      &lt;/select&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>please help me.thanks</p>