Variables & Values
User Input
Console Output
Randomizer (CodeHS)
Functions & Vocabulary
100

This keyword creates a variable whose value can be updated later.

What is let?

100

This function is used to ask the user for their name or any other text.

What is readLine()?

100

This function is used to display messages in the console.

What is console.log()?

100

This function gives you a random whole number between two values.

What is Randomizer.nextInt(start, end)?

100

This keyword is used to define a function in JavaScript.

What is function?

200

This is the value stored in the variable after this code runs:


let x = 5 + 4 * 3;
console.log(x);

What is a 17?

200

This number will be printed if the user types 6 at the prompt:


let num = readInt("Enter a number:");
console.log(num + 2);

What is 8?

200

This is printed to the screen:


console.log("Hello, world!");

What is "Hello, world!"?

200


This number is always printed:


console.log(Randomizer.nextInt(1, 1));

What is 1?

200

In pair programming, this person writes the code.

Who is the Driver?

300

This keyword creates a variable that cannot be reassigned.

What is const?

300

This function asks the user to enter a decimal number.

What is readFloat()?

300

This is the full output:


let a = 4;
let b = 3;
console.log("Sum is: " + (a + b));

What is "Sum is: 7"?

300

This function gives a random decimal between two values.

What is Randomizer.nextFloat(start, end)?

300

This is what happens if you define a function but never call it.

What is nothing?

400

This number is printed to the screen:

let x = 10;
x = x - 2 * 3;
console.log(x);


What is 4?

400

This value is stored in the variable:


let word = readLine("Say something:");
// User types: banana

What is "banana"?

400

This is the result when the following code runs:


console.log(5 + 3 + " stars");

What is "8 stars"?

400

This is one possible output of this code:


let result = Randomizer.nextInt(3, 5);
console.log(result);

What is 3, 4, or 5?

400

This symbol assigns a value to a variable in JavaScript.

What is the assignment operator (=)?

500

This is the final value of score:

let score = 7;
score = score + 2;
score = score * 3;


What is 27?

500

This is what happens if you run this code and the user types "pizza":


let food = readInt("Favorite food?");
console.log(food);

What is nothing?

500

p>This happens if you forget the closing quote in a console.log() line.



console.log("Missing quote);

What is a syntax error?

500

This is the output range for this code:


Randomizer.nextFloat(0, 1);

What is any decimal between 0 and 1?

500

This is how you create a function that takes no input and prints "Done!"

What is:

 function showDone() {
  console.log("Done!");
}