title: probability in javascript help?
body: <p>Sorry, I'm new to JS and can't seem to figure this out: how would I do probability?</p>
  
  <p>I have absolutely no idea, but I'd like to do something: out of 100% chance, maybe 0.7% chance to execute function <code>e();</code> and 30% chance to execute function <code>d();</code> and so on - they will add up to 100% exactly with a different function for each, but I haven't figured out exactly how to do this in any form. </p>
  
  <p>What I found is mostly strange high school math tutorials "powered by" Javascriptkit or something.</p>