title: Working with number basic type and indexOf in TypeScript
body: <p>How can I get indexOf to play nice with TypeScript number basic type, now it is alway returning -1 even if it does exist? </p>
  
  <p>On the <strong>SelectElement</strong> class I have a property "extra" containing an object with a key called "when" which is an array of numbers as defined on the <strong>SelectElementInterface</strong>.</p>
  
  <p>Now on the <strong>SelectElement</strong> class, I also have property value which is also of type number.</p>
  
  <p>But when running the code in the <strong>displayExtra</strong> method on the <strong>SelectElement</strong> class I am running into an issue regarding indexOf. The outputs of the console logs look like the following </p>
  
  <pre><code>[16:28:20]  console.log: [1,2]
  [16:28:20]  console.log: 1
  [16:28:20]  console.log: -1
  </code></pre>
  
  <p>As you can see from the console logs the value does exist and they should be of the same type according to my interface. Is this a bug in TypeScript or am I missing something here and how can I get indexOf to work with the basic number type in TypeScript? </p>
  
  <p><strong>SelectElement class</strong></p>
  
  <pre><code>export class SelectElement extends Element&lt;number&gt; {
      public options: object;
      public extra: SelectElementInterface;
  
      constructor(options: ElementInterface, selectOptions: object, extra: SelectElementInterface) {
          super(options);
          this.options = selectOptions;
          this.extra = extra;
      }
  
      public displayExtra(): boolean {
          console.log(JSON.stringify(this.extra.when));
          console.log(this.value);
          console.log(this.extra.when.indexOf(this.value));
  
          return this.extra.when.indexOf(this.value) &gt; -1;
      }
  }
  </code></pre>
  
  <p><strong>The element super class</strong></p>
  
  <pre><code>export abstract class Element&lt;type&gt; {
  
      public id: number;
      public type: string;
      public label: string;
      public required: boolean;
      public value: type;
  
      constructor(options: ElementInterface) {
          this.id = options.id;
          this.type = options.type;
          this.label = options.label;
          this.required = options.required;
      }
  
      abstract displayExtra(): boolean;
  }
  </code></pre>
  
  <p><strong>ElementInterface</strong></p>
  
  <pre><code>export interface ElementInterface {
      id: number,
      type: string,
      label: string,
      required: boolean,
      value: string
  }
  </code></pre>
  
  <p><strong>SelectElementInterface</strong></p>
  
  <pre><code>export interface SelectElementInterface  {
      input: string,
      label: string,
      required: boolean,
      when: Array&lt;number&gt;,
      value: string
  }
  </code></pre>
  
  <p><strong>Edit:</strong> Removed typos and code not necessary to the example.</p>