How to get random element from array in JavaScript

Arrays
Last updated Jan 08, 2018
const names = ["Tom", "Jad", "Nicole"];

names[Math.floor(Math.random() * names.length)];
a random element from the names array