//Math object can not be changed console.log(Math.PI); function randomSelection(arr){ let index = Math.floor(Math.random()*arr.length); return arr[index]; } let happiness = ['Hope','Joy','Peace','Love','Kindness','Puppies','Kittens','Tortoise']; for (i=0; i < 8; i++){ console.log(randomSelection(happiness)); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter