title: Using classes in for loop in node.js
body: <p>To be honest, I don't know what to ask for my case so I'll just add some details. I come from java so I am familiar with classes.</p>
  
  <p>Let's take for instance a class and for making it easy, drop the private fields to public and no getter and setter</p>
  
  <pre><code>class User{
   public String name;
   public String email;
  }
  </code></pre>
  
  <p>This is useful in certain cases, for instance have an array of users and then I can use something like:</p>
  
  <pre><code>for(User user: usersList){
     user.name='some new value'
     //since user is a class, code assist, suggests the name and also if I have user.namee it throws an error
  }
  </code></pre>
  
  <p>Now moving into javascript, I can obtain an array and do something like</p>
  
  <pre><code>for (let user of usersList){
      user.name='some new value'
      //however if I type user.nammee no error is thrown and code assist does not know what to recomment
  }
  </code></pre>
  
  <p>I think that now you may get the idea. I want it to make it easier to properly obtain the object fields with code assist and also avoid typing errors because of property name badly typed. Javascript classes from what I see have only methods... so what can I apply in this case?</p>