title: Loop through <select> and build array in the format: "value1","value2","value3"
body: <p>I wonder if anyone could suggest the best way of looping through all the <code>&lt;option&gt;</code> s in a  <code>&lt;select&gt;</code> element with jQuery, and building an array.</p>
  
  <p>Eg.</p>
  
  <p>Instead of the following, whereby a string ins passed to the autoCompleteArray(),</p>
  
  <pre><code>$("#CityLocal").autocompleteArray(
          [
              "Aberdeen", "Ada", "Adamsville", "Zoar" //and a million other cities...
          ],
          {
              delay:10,
              minChars:1,
              matchSubset:1,
              onItemSelect:selectItem,
              onFindValue:findValue,
              autoFill:true,
              maxItemsToShow:10
          }
      );
  </code></pre>
  
  <p>...I need to loop through all the <code>&lt;options&gt;</code> in a  <code>&lt;select&gt;</code> and push them into an array, and just pass that array variable to the function instead of a long string.</p>
  
  <p>Eg,</p>
  
  <pre><code>$("#CityLocal").autocompleteArray(
              [
                  MyBigArrayOfOptions
              ],
              {
                  delay:10,
                  minChars:1,
                  matchSubset:1,
                  onItemSelect:selectItem,
                  onFindValue:findValue,
                  autoFill:true,
                  maxItemsToShow:10
              }
          );
  </code></pre>
  
  <p>I'd be grateful if you could suggest how to push stuff into an array in the correct format. I've pretty much sussed the looping part from another post on this site.</p>
  
  <p>Thanks.</p>