Answer the question
In order to leave comments, you need to log in
How can I output random lines in a variable to the console?
var abra = ["ABC", "Babylka", "Doctor", "Hospital", "IT", "DataBase", "AbrakaDabra", "Bye", "Hi", "Alphabet", "Da", "No", "Yes"]
console.log(abra)
Answer the question
In order to leave comments, you need to log in
This will output one value. Then add yourself.
const abra = ["ABC", "Babylka", "Doctor", "Hospital", "IT", "DataBase", "AbrakaDabra", "Bye", "Hi", "Alphabet", "Da", "No", "Yes"]
const random = Math.floor(Math.random() * abra.length);
console.log(random, abra[random]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question