Variables Flashcards
hold reusable data in a program and associate it with a name.
are stored in memory
Variables
is the preferred way to declare a variable when it can be reassigned
let
is the preferred way to declare a variable with a constant value.
const
The ______ keyword returns the data type (as a string) of a value.
The ______ operator checks the value to its right and returns, or passes back, a string of the data type.
typeof
is a JavaScript keyword that creates, or declares, a new variable.
var
we used the += assignment operator to reassign w. We’re performing the mathematical operation of the first operator + using the number to the right, then reassigning w to the computed value.
-=, *=, and /=
let w = 4; w += 1;
console.log(w); // Output: 5
The increment operator will increase the value of the variable by 1. The decrement operator will decrease the value of the variable by 1.
++
–