title: Is there a simpler way to implement a probability function in JavaScript?
body: <p>There's an <a href="https://stackoverflow.com/questions/3983660/probability-in-javascript-help">existing question / answer</a> that deals with implementing probability in JavaScript, but I've read and re-read that answer and don't understand how it works (for my purpose) or how a simpler version of probability would look.</p>
  
  <p>My goal is to do:</p>
  
  <pre><code>function probability(n){
      // return true / false based on probability of n / 100 
  }
  
  if(probability(70)){ // -&gt; ~70% likely to be true
      //do something
  }
  </code></pre>
  
  <p>What's the simple way to achieve this?</p>