var submit = document.getElementById("submit"); var value = document.getElementById("value"); var greeting = ['hi', 'hello', 'Hlw', 'hello jii', 'hey', 'helo', 'hi there', 'hey'] var greetReply = ['hlw', 'kisu na', 'gaan shuni']; submit.addEventListener('click', () => { const reply = Math.floor(Math.random() * greetReply.length); // random reply! for (let i = 0; i < greeting.length; i++) { if(value.value === greeting[i]){ console.log(reply) } } })debe acceder al valor de la matriz por el número de índice, intente modificar esta línea:
console.log(greetReply[reply])la respuesta es un índice aleatorio de greetReply para obtener el valor de ese índice, utilícelo de esta manera greetReply[reply]