string indices in javascript
how can i get a random value from the array if it has string indices ?
console.log(array[Math.random() * array.length])
even if the indices are strings ?
i don't think that will work
you want to get specific string right?
get random object from here and check if it's a string 🌚
const array = Object.values(object); const item = array[Math.floor(Math.random() * array.length))];
Обсуждают сегодня