title: How should an array be passed to a Javascript function from C#?
body: <p>I use a WebBrowser object from WPF and I'm calling some Javascript code in the page loaded in the browser like this:</p>
  
  <pre><code>myWebBrowser.InvokeScript("myJsFunc", new object[] { foo.Text, bar.ToArray&lt;string&gt;()});
  </code></pre>
  
  <p>Now, the js function is supposed to iterate over the elements of the second parameter (an array of strings) and do stuff accordingly.  The only issue is that the parameter seems not to be passed as a js array.</p>
  
  <p>For example,</p>
  
  <pre><code>alert(typeof theArray);
  </code></pre>
  
  <p>alerts "Unknown".</p>
  
  <p>What is the proper way to pass an array as a parameter when invoking a js function from CSharp? </p>