title: how to map array of strings while assigning priorities
body: <p>I want to map some strings to numbers which are used to priorities each one of them, the following way works fine but I don't think its the best way to do it.</p>
  
  <p>any suggestions on how to write this piece of code in a better way ?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  private readonly PRIORITY: Map&lt;string, number&gt; = new Map&lt;string, number&gt;([
          ['XDR', 1],
          ['PT1M', 2],
          ['PT1M_', 2],
          ['PT5M', 3],
          ['PT5M_', 3],
          ['PT15M', 4],
          ['PT15M_', 4],
          ['PT1H', 5],
          ['PT1H_', 5],
          ['P1D', 6],
          ['P1D_', 6],
          ['P7D', 7],
          ['P1W', 7],
          ['P1M', 8]
      ]);
      private  getsAsPriorityMap(): Map&lt;string, number&gt; {
          const result: Map&lt;string, number&gt; = new Map&lt;string, number&gt;();
          const Widgets = ViewManager.getView().getWidgets();
          Widgets.forEach(graphWidget =&gt; {
              const gran = QueryProcessorService.getWidgetApplied(Widget);
              if (gran) {
                  result.set(gran, this.PRIORITY.get(gran));
              }
          });
          return result;
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>the way the array looks is confusing I want to write in a way in which it would be easily readable by anyone reading my code</p>