Skip to content

Instantly share code, notes, and snippets.

@desinas
Created December 8, 2017 15:37
Show Gist options
  • Save desinas/208ddf5aca7b4d0e985795fc9e88df76 to your computer and use it in GitHub Desktop.
Save desinas/208ddf5aca7b4d0e985795fc9e88df76 to your computer and use it in GitHub Desktop.
Data types and Variables example Udacity plus extra example
/*
* 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
@desinas
Copy link
Author

desinas commented Dec 20, 2017

What Went Well

  • Your code should have a variable adjective1
  • Your code should have a variable adjective2
  • Your code should have a variable adjective3
  • Your code should have a variable madLib
  • Your madLib should include adjective1
  • Your madLib should include adjective2
  • Your madLib should include adjective3
  • Your madLib should match the given string

Feedback: Your answer passed all our tests! Awesome job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment