title: jQuery: How to traverse / Iterate over a list of object
body: <p>I'm using asp.net MVC4 for web app development.</p>
  
  <p>I would like to traverse a list of objects from a ViewModel.</p>
  
  <p>Below is the class of the object:</p>
  
  <pre><code>public class User
  {
          public int Id {get; set;}
          public string Name {get; set;}
          public string Address {get; set;}
          public string Department {get; set;}
  }
  </code></pre>
  
  <p>Below is my <code>ViewModel</code> class:</p>
  
  <pre><code>public class UserViewModel
  {
        public List&lt;User&gt; AllUsers {get; set;}
        public bool IsDeleted {get; set;}
  }
  </code></pre>
  
  <p>As seen in the <code>UserViewModel</code> class, I have a list of objects of type <code>User</code>. Now i would like to iterate through each of the user object in <code>AllUsers</code> list using <code>Jquery</code> and fetch data from them.</p>
  
  <p>In order to do so, I tried doing something like the following:</p>
  
  <pre><code>$(@Model.AllUsers).each( function(){ .... });
  </code></pre>
  
  <p>I have tried different combination using the above approach, but couldn't succeed. Can anyone suggest a solution for the same.</p>
  
  <p>Thanks in advance.</p>