Created
December 8, 2017 15:37
-
-
Save desinas/208ddf5aca7b4d0e985795fc9e88df76 to your computer and use it in GitHub Desktop.
Data types and Variables example Udacity plus extra example
This file contains 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
/* | |
* Programming Quiz: MadLibs (2-11) | |
* | |
* 1. Declare a madLib variable | |
* 2. Use the adjective1, adjective2, and adjective3 variables to set the madLib variable to the message: | |
* | |
* 'The Intro to JavaScript course is amazing. James and Julia are so fun. I cannot wait to work through the rest of this entertaining content!' | |
*/ | |
var adjective1 = 'amazing'; | |
var adjective2 = 'fun'; | |
var adjective3 = 'entertaining'; | |
var madLib = "The Intro to JavaScript course is " | |
+ adjective1 + ". James and Julia are so " | |
+ adjective2 + ". I cannot wait to work through the rest of this " | |
+ adjective3 + " content!";// String Concatenation example | |
// An extra example, have the same effect over string using Interpolation | |
var madLib = `The Intro to JavaScript course is ${adjective1}. James | |
and Julia are so ${adjective2}. I cannot wait to work through | |
the rest of this ${adjective3} content!`;// String Interpolation using Template Literals example |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What Went Well
Feedback: Your answer passed all our tests! Awesome job!