title: `to` function for a number in Scala?
body: <p>What does <code>to</code> function do in:</p>
  
  <pre><code>rdd.flatMap(x =&gt; x.to(3))
  </code></pre>
  
  <p>?</p>
  
  <p><code>rdd</code> is composed of <code>{1, 2, 3, 3}</code> and the above function returns <code>{1, 2, 3, 2, 3, 3, 3}</code>
  I have been googling "scala number to function" and its variants, but can't seem to find what it does.</p>