Popcorn Hack 1: Variable Naming, and Strings in JavaScript

Instructions:

  1. Open a new cell and set its type to Code.

  2. Using the correct variable naming case for JavaScript

  3. Create a string variable for "gameQuestion" and let it equal: "My favorite video game is "

  4. create a variable for "gameAnswer" and let it equal: your favorite game

  5. output your gameQuestion and gameAnswer to the console [EX: console.log(gameQuestion + gameAnswer);]

  6. Open your console and see if it displayed the correct message

%%js


let gameQuestion = "cheese is..."; //This is a string variable
let answer = "awesome"; //This is a string variable

console.log(gameQuestion); //This will print "How much do you like this lesson?"
console.log(answer); //This will print "a lot!"

Popcorn Hack 2: Null, Undefined, Symbol, in JavaScript

Instructions:

  1. Open a new cell and set its type to Code.

  2. Create a variable nullVar and set it to null.

  3. Create a variable undefinedVar and leave it uninitialized.

  4. Create a variable symbolVar and set it to a new Symbol with a description of your choice. [EX: let myRPG = Symbol("Pokemon");]

  5. Output all three variables to the console using console.log().

%%js

let nullVar = null; //This is a null variable
let undefinedVar; //This is an undefined variable
let symbolVar = Symbol("Provelone"); //This is a symbol variable

console.log(nullVar); //This will print null
console.log(symbolVar); //This will print Symbol(Pokemon)
console.log(undefinedVar); //This will print undefined


<IPython.core.display.Javascript object>