Javascript Array random_item()

Description

Javascript Array random_item()


'use strict';/*w w  w  . j a v  a 2  s . c o  m*/

Array.prototype.random_item = function () {
    return this[Math.floor(Math.random() * this.length)];
};



PreviousNext

Related