Goal: Practice creating and utilizing variables and strings by completing the exercises listed below. Variables and strings are both a fundamental building block of programming, so begin getting comfortable with them now!
In the Variables lesson, we learned:
let
and const
.In the Strings lesson, we learned:
\
character.let
and const
used? What do they mean — and how are they different from var
?"9"
with quotes and 9
without?Here are a few exercises for you to practice using variables in the DevTools console:
someName
equal to your name in a string. We should be able to reassign the value of someName
, so choose whether you should use let
or const
to declare this variable.someName
in the console.someName
to your pair's name.Switch who's driving and observing and continue with these next practice items:
favoriteNumber
equal to your favorite number. The variable favoriteNumber
should not be able to be reassigned, so choose whether you should use let
or const
to declare this variable.halfOfFavNum
. This variable should not be able to be reassigned, so choose whether you should use let
or const
to declare this variable.michaelsFavorite
equal to 13
. We should be able to reassign the value of michaelsFavorite
, so choose whether you should use let
or const
to declare this variable.michaelsFavorite
to be 26 times its current value.