Get Random Array Item

Select and return a random element from an array.

Code

General
arr[Math.floor(Math.random() * arr.length)];

Parameters

Array to pick from

Browser·fetch() may be limited by CORS

More JavaScript Snippets