Javascript Array getRand()

Description

Javascript Array getRand()


Array.prototype.getRand = function () {

    var rand = Math.floor(Math.random() * (this.length - 0)) + 0;

    return this[rand];

}



PreviousNext

Related