title: How to compare two typed objects (with interface) in React?
body: <p>There is a need to get the delta (key/val) of the changed attributes between two object.
  The code is typescript.
  The two objects were created by same interface.</p>
  
  <pre><code>export interface ITestObj {
     att1: string;
     att2: string[];
     att3: string;
  }
  </code></pre>
  
  <p>I'm getting error that object's attribute can't be used as index.
  Can't do something like this:</p>
  
  <pre><code>if(objA['att1'] !== objB['att1']) {
  }
  </code></pre>
  
  <p>Trying to fix this, I tried to modify the interface to:</p>
  
  <pre><code>export interface ITestObj {
         [att1: string]: string;
         att2: string[];
         att3: string;
      }
  </code></pre>
  
  <p>but this is can't be done as not all attributes are string (or number for this matter...).</p>
  
  <p>How can I get the attributes that are different between objA and objB?</p>
  
  <p>Thank you very much.</p>