title: How to transform Object into Array with key and values?
body: <p>I have been trying to use the tag cloud module from <a href="https://github.com/d-koppenhagen/angular-tag-cloud-module" rel="nofollow noreferrer">https://github.com/d-koppenhagen/angular-tag-cloud-module</a> and my data object is like this:</p>
  
  <pre><code>{ "Speech": 4, "E-commerce": 1, "Meeting": 1, "Garena": 1 , "Silicon valley": 1}
  </code></pre>
  
  <p>According to the module's guide, the data array should insert like this below:</p>
  
  <pre><code>[ {text: "Speech", weight: 4}, {text: "E-commerce", weight: 1}, {text: "Meeting", weight: 1},{text: "Garena", weight: 1}, {text: "Sillicon valley", weight: 1}]
  </code></pre>
  
  <p>My code is at below, just recently coding with Typescript and hope someone can give me a hint!</p>
  
  <pre><code> var post_tags: Array&lt;string&gt; = post['tags'];
  
        post_tags.forEach(element =&gt; {
          this.counts[element] = ( this.counts[element] || 0)+1;
          this.tags.push({
            text: Object.keys(this.counts),
            weight: this.counts[element]
          });           
        });
  </code></pre>