title: Underscore creating arrays based on object key
body: <p>Let's say I have a js object such as this</p>
  
  <pre><code>{
      a: 5,
      b: 1,
      c: 3
  }
  </code></pre>
  
  <p>What I would like to do using Underscore is generate an array which would resemble the following;</p>
  
  <pre><code>["a","a","a","a","a","b","c","c","c"]
  </code></pre>
  
  <p>I can achieve what I want with the following code</p>
  
  <pre><code>var i = {
      a: 5,
      b: 1,
      c: 3
  };
  
  unpack = function (i, item) {
      var items = [];
      _.range(0, i).forEach(function (i) {
          items.push(item)
      })
      return items;
  }
  
  console.log(_.flatten(_.map(i, unpack)));
  </code></pre>
  
  <p><a href="http://jsfiddle.net/VCFZx/" rel="nofollow">http://jsfiddle.net/VCFZx/</a> but it doesnt seem the tidiest way of doing it?</p>