JS Primitives and Variables Flashcards
What is the purpose of variables?
to store information
How do you declare a variable?
keyword and name
How do you initialize (assign a value to) a variable?
equal sign
What characters are allowed in variable names?
$, _ , letters
What does it mean to say that variable names are “case sensitive”?
must always be typed with a consistent capitalization of letters
What is the purpose of a string?
used for storing and manipulating text.
What is the purpose of a boolean?
to tell if the value is true of false
What does the = operator mean in JavaScript?
to assign
How do you update the value of a variable?
typing the variable name and the new value
What is the difference between null and undefined?
null is an assigned value
undefined means a variable has been declared but not defined yet
Why is it a good habit to include “labels” when you log values to the browser console?
help you debug
Give five examples of JavaScript primitives.
string, number, boolean, undefined, null