alert 2 arrays in same line javascript <p>I have a problem alerting out 2 arrays on same line in Javascript. The user should write Movie name and movie rating(1-5) 5 times, and <code>printMovies()</code> function should print out users (movie)name and (movie)rating in a single line something like this:</p> <pre><code>Movie Rating Star Wars 5 Lord of the Rings 4 Casino 4 Movie4 3 Movie5 2 </code></pre> <p>How do I alert out all of five inputs in a single line (movie + rating) per line, AFTER they have got input from user?</p> <p>//CODE</p> <pre><code>var title; var rating; var a = []; var movies = []; var ratings = []; function buttonAddMovie()//Button onclick { addMovie(title, rating) addMovie(title, rating) addMovie(title, rating) addMovie(title, rating) addMovie(title, rating) } function addMovie(title, rating) { do{ title = prompt("Enter movie: "); } while (title == ""); do { rating = parseInt(prompt("Enter rating 1-5 on movie " + (title))); } while (rating &gt; 5 || rating &lt; 1); movies.push(title);//Pushing title to movies a.push(movies);//Pushing movies to a array ratings.push(rating);//Pushing rating to ratings a.push(ratings);//Pushing ratings to a array printMovies() } function printMovies() { for (var i = 0; i &lt; a.length; i++) { alert(a[0][0] + " " + a[0][1]);//Here is my biggest problem! } } </code></pre>