title: (TypeScript2) How do you loop through an array of interface type?
body: <p>While using a for loop my let object has the type of string, even though the object I am iterating through is of a type defined in an interface.</p>
  
  <p>Below is the code I am using. When trying to access mapping.attribute which is defined on the interface as a string, I get the error [Property 'attribute' does not exist on type 'string'.]</p>
  
  <p>I have the following interface and function :</p>
  
  <pre><code>interface IMapping {
      attribute: string;
      property: string;
  }
  
  mapAttributes(mappings: IMapping[], values) {            
      for (let mapping in mappings) {
          if (mapping.hasOwnProperty("attribute")) {
              console.log(this.attributes.find(attribute =&gt; attribute.name === mapping.attribute).value);
          }
      }
  }
  </code></pre>
  
  <p>How should the for loop be defined so that I can use a property that has been defined in my interface?</p>