title: How to read ViewBag list in jquery
body: <p>I have a list that I want to pass from my Controller to my View and use JQuery to loop through the list. In my jquery, I can see the ViewBag object but how do I expand the data to actually use it?</p>
  
  <p>My Controller and View are like this:</p>
  
  <pre><code>//Controller Index()
  var states = GetStatesAvailable();
  ViewBag.MyStates = new SelectList(states, "stateID", "Description");
  return View();
  
  
  //View
  &lt;script type="text/javascript"&gt;
  var statesAvailable = "@ViewBag.MyStates";
  //Loop through statesAvailable?
  &lt;/script&gt;
  </code></pre>