title: JavaScript - shorten math function
body: <pre><code>function randomize() {
  var ra = Math.floor(Math.random()*ar.length=4);
  document.getElementById('es').innerHTML = ar[ra];
  }
  </code></pre>
  
  <p>Is there a way to short this code even more than it is? The reason why is because I'm going to be using  this code a lot in other projects and objects and I cannot just call it inside like this: randomize(); because I have diffrent arrays.</p>