es6 random array element code example Example: get random element from array js var item = items[Math.floor(Math.random() * items.length)];