Another worthy one for the notebooks, the random entry of an array!
Array.prototype.random = function() {
return this[Math.floor(Math.random()*this.length)];
};
Useful in applications that require the gathering of a random value…duhh
Another worthy one for the notebooks, the random entry of an array!
Array.prototype.random = function() {
return this[Math.floor(Math.random()*this.length)];
};
Useful in applications that require the gathering of a random value…duhh