Guest User

Untitled

a guest
Dec 11th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. /*
  2. * Programming Quiz: MadLibs (2-11)
  3. *
  4. * 1. Declare a madLib variable
  5. * 2. Use the adjective1, adjective2, and adjective3 variables to set the madLib variable to the message:
  6. *
  7. * '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!'
  8. */
  9.  
  10. var adjective1 = 'amazing';
  11. var adjective2 = 'fun';
  12. var adjective3 = 'entertaining';
  13.  
  14. var madLib = "The Intro to JavaScript course is "
  15. + adjective1 + ". James and Julia are so "
  16. + adjective2 + ". I cannot wait to work through the rest of this "
  17. + adjective3 + " content!";// String Concatenation example
  18.  
  19. // An extra example, have the same effect over string using Interpolation
  20. var madLib = `The Intro to JavaScript course is ${adjective1}. James
  21. and Julia are so ${adjective2}. I cannot wait to work through
  22. the rest of this ${adjective3} content!`;// String Interpolation using Template Literals example
Add Comment
Please, Sign In to add comment