Extra Practice
Remember: Learning to program takes practice! It helps to see concepts over and over, and it's always good to try things more than once. We learn much more the second time we do something. Use the exercises and additional self-checks below to practice.
// Refer to this code to answer the questions.
let x = 12;
let y = 3;
let z = x % y;
let foo = 5;
x = 16;
let bar = x % foo;
/* let z = 42; */
let baz = z + bar;
What is the first line of the code above?
What do we call x
and y
?
x
and y
are variables.At the end of this script, what is x
equal to?
x
is equal to 16.At the end of this code, what is baz
equal to?
12
36
0
1
baz
is equal to 1
.At the end of this code, why doesn't z
equal 42?
z
to that value has been commented out.z
is a constant and cannot be updated.z
is not equal to 42
because the line setting that value has been commented out.Visit Content Online
The content on this page has been removed from your PDF or ebook format. You may view the content by visiting this book online.