title: Returning array from apex controller class and using in javascript in Salesforce
body: <p>I want to return an array from apex custom controller class in visualforce and use that array in JavaScript.</p>
  
  <p>How I am doing:</p>
  
  <pre><code>Javascript:
     var SFObjectArray;
     function myJavascriptMethod()
     {
        SFObjectArray = myArrayItems();
     }
  
  
  Apex:
  &lt;apex:actionFunction name="myArrayItems" 
                       action="{!myArrayItems}" 
                       status="mystatus" 
                       reRender="out"/&gt;
  &lt;/apex:actionFunction&gt;
  
  Controller:
  
  public class MyController
  {
    String[] arrayItems;
  
     public PageReference myArrayItems()
      {
         arrayItems = new String[]{'abc','def'};
          return null;
      }
  
      public String[] getItems()
       {
         return arrayItems ;
       }  
  }
  </code></pre>
  
  <p>can anybody provide me some help.</p>