title: JavaScript: How to interpret a variation of the `Math.floor(Math.random)` method?
body: <p>It seems that <code>Math.random()*3|0</code> equates to <code>Math.floor(Math.random() * 3)</code>, which is the version I'm familiar with. While I have no problem understanding the step-by-step process of how the latter generates integers 0, 1, and 2, the structure of the former stumps me. It may well be an idiomatic variation of the more roundabout <code>Math.floor</code> method.</p>
  
  <p>Is it possible to express the following two snippets of code in <code>x|y</code> style instead and produce the same results? If so, could you break down how it works?</p>
  
  <hr>
  
  <pre><code>1 + Math.floor(Math.random() * 100) // yielding 1-100 (inclusive)
  
  190 + Math.floor(Math.random() * 66) // yielding 190-255 (inclusive)
  </code></pre>