📅  最后修改于: 2022-03-11 15:02:12.681000             🧑  作者: Mango
//Function to make it easier
Array.prototype.random = function() {
return this[Math.floor((Math.random() * this.length))];
};
var colors = ["red","blue","green","yellow"];
var randomColor = colors.random();