title: Argument of type 'string | number' is not assignable to parameter of type 'number'
body: <p>Question Modified  With an example method to the end: -</p>
  
  <p>I have an interface as shown below for typing an object.</p>
  
  <pre><code>export interface IList{
    name: string;
    age: number;
    option: number;
    quantity: number;
    priority: number;
  }
  </code></pre>
  
  <p>Due to some requirement I have to assign a "string" to the "priority" property at the end of all operations before sending it to the backend.</p>
  
  <p>As I've to assign a string, I tried using a union operator :-</p>
  
  <p>priority : number | string;
  But all the other pieces of code wherever I used other operations taking this as a number into consideration is also throwing me the below error:</p>
  
  <pre><code>Argument of type 'string | number' is not assignable to parameter of type 'number'
    Type 'string' is not assignable to type 'number'.
  </code></pre>
  
  <p>How do I get around this and use priority as a both a string and number to type my object.</p>
  
  <p>Here is one condition where I am using the "IList" interface as a type and assigning a number if multiGroupHeader is true, else I have to assign a string :-</p>
  
  <pre><code>public updatePriorities(Lists: IList[]) {
    if (!this.multiGroupHeader) {
      const priorities = Lists.map((list: IList) =&gt; list.priority);
      const uniquePriorities = [...new Set(priorities)];
      if (uniquePriorities.length === 1 &amp;&amp; uniquePriorities[0] === 1) {
        return;
      }
      uniquePriorities.sort((priority1: number, priority2: number) =&gt; priority1 - priority2);
      const updatedPriorities = uniquePriorities.map((priority: number, index: number) =&gt; {
        return index + 1;
      });
  
      uniquePriorities.forEach((id: number, index: number) =&gt; {
        Lists.forEach((list: IList) =&gt; {
          if (list.priority === id) {
            list.priority = updatedPriorities[index];
          }
        });
      });
    } else {
      Lists.forEach((list: IList) =&gt; (list.priority = "CURRENT"));
    }
  }
  </code></pre>