Created
January 17, 2016 02:18
-
-
Save duggiemitchell/51973c0b627132311503 to your computer and use it in GitHub Desktop.
Two-Dimensional Arrays
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Check out the following setup. Enter a line of code that declares a variable called infant and uses the array eightiesMovies to access the word "Baby". | |
| var movie1 = [16, "Candles"]; | |
| var movie2 = [3, "Men", "and", "a", "Baby"]; | |
| var eightiesMovies = [movie1, movie2]; | |
| > var infant = eightiesMovies[4]; | |
| ____ | |
| Now alert a string with the full title of the first movie in the eightiesMovies array, but only using the eightiesMovies variable to access the correct values. Use the concatenation operator to unite the words into one string, and remember to be attentive to necessary whitespace! | |
| var movie1 = [16, "Candles"]; | |
| var movie2 = [3, "Men", "and", "a", "Baby"]; | |
| var eightiesMovies = [movie1, movie2]; | |
| alert(eightiesMovies[0][0]+ " " +eightiesMovies[0][1]); //OR | |
| alert(eightiesMovies.join("")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment