Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

codegreper

Get random element from JavaScript array
Array.prototype.randomize = function () {
	return this[Math.floor((Math.random()*this.length))];
}

let arrays = Array('me', 'you', 'us', 'people')

arrays.randomize()
 
PREVIOUS NEXT
Tagged: #codegreper
ADD COMMENT
Topic
Name
3+1 =