jeudi 23 janvier 2020

How can I create a function to call a random variable and then call a random from the array of the first random? [closed]

var movieFlavor = ['War', 'Love', 'True', ]

var warMovies = ['Pearl Harbor', 'PT 109', 'FireBase Gloria', ]

//Button to get Movie Flavor

function randMovieFlavor() {
  var randomNumber = Math.floor(Math.random() * (movieFlavor.length));
  document.getElementById('movieDisplay3').innerHTML = movieFlavor[randomNumber];
}

//Button (trying) to get a random movie from the flavor array answer.
function craigsPick() {
  var randomNumber = Math.floor(Math.random() * (randMovieFlavor.length) * movieFlavor);
  document.getElementById('movieDisplay').innerHTML = randMovieFlavor * movieFlavor[randomNumber];
}

What kind of more details without writing a book?




Aucun commentaire:

Enregistrer un commentaire