title: How to Enumerate a Dictionary<> in Jint
body: <p>I have a .NET Generic Dictionary&lt;> that I want to pass to a JavaScript function which I am running in Jint.</p>
  
  <p>Jint doesn't treat the .NET Dictionary like a JavaScript object which can be treated like a Dictionary. You can access the .NET properties and methods on the object but not the Extension methods.</p>
  
  <p>So while I can get a count of the Dictionary Keys I cannot enumerate it or call ToArray() on it.</p>
  
  <p>I can used dict[key] to read values out of the Dictionary but in this instance I do not know the keys in advance.</p>
  
  <p>How can I enumerate the keys or get all entries in the .NET Generic Dictionary?</p>
  
  <p>I'm open to doing something to the dictionary or converting it before I pass it it in or figuring out how to do it in the JavaScript. I would prefer not to have to pass an array of the keys separately. This is inside another data structure and doing that for each dictionary would make it more complicated but it is one of the options that I'm considering if I can't find another solution.</p>
  
  <p>I would prefer to stay away from using dynamics. I've had trouble with them leaking memory when used heavily in the past. </p>