Return random el from array

PHOTO EMBED

Tue Jun 22 2021 08:15:53 GMT+0000 (Coordinated Universal Time)

Saved by @hisam #javascript #vanilla #array

function randomEl(array) {
	const idx = Math.floor(Math.random() * array.length);
	return array[idx];
}
content_copyCOPY