Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. // Assign the string "Ken the Ninja" to the name variable
  2. //Define
  3. var name; // note: using "let" is better than using "var"
  4.  
  5. //Assign
  6. name = "Ken the Ninja"; // enclosed in quotes
  7.  
  8. // Print the name variable
  9. //Print the value of the name variable to the console.
  10. console.log(name); // I'm getting the "value" of name from name itself
  11.  
  12. // Print "name" as a string
  13. //Let's also check that a variable becomes a string if you enclose it in quotes.
  14. console.log("name"); //I'm printing a string literal. Literally name, not the variable called name.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement