title: Hashset in TypeScript
body: <p>I am attempting to do something very basic in TypeScript. <a href="https://stackoverflow.com/questions/24196067/what-is-the-javascript-equivalent-to-a-c-sharp-hashset">Get a list of unique strings while parsing a map as referenced in this post.</a></p>
  
  <p>Here is what I am attempting to do:</p>
  
  <pre><code>let myData = new Array&lt;string&gt;();
  for (let myObj of this.getAllData()) {
      let name = myObj.name;
      console.log("## we have " + name);
      console.log("### is property ? " + myData.hasOwnProperty(name));
      if (!myData.hasOwnProperty(name)){
          myData.push(name);
      }
  }
  </code></pre>
  
  <p>My printout will always evaluate to false for any string, duplicate or not. Here is some sample output:</p>
  
  <pre><code> ## we have COW
   ### is property ? false
   ## we have COW
   ### is property ? false
   ## we have RAODN
   ### is property ? false
   ## we have COOL
   ### is property ? false
  </code></pre>
  
  <p>However, when the process completes, my list contain duplicates. I have tried looking at this <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" rel="noreferrer">documentation</a>, but there is no mention of a 'hashset' or any set in general.</p>
  
  <p>Is there something equivalent in TypeScript of a Set? i.e A list of unique elements</p>