javascript-primitives-and-variables Flashcards
What is the purpose of variables?
store data
How do you declare a variable?
keyword and identifier
How do you initialize (assign a value to) a variable?
assign a value
What characters are allowed in variable names?
Letters, $, _ (underscore). NO dashes or periods
lowercase - camelCase if more than one word
What does it mean to say that variable names are “case sensitive”?
Case matters to reference same variable
What is the purpose of a string?
What is the purpose of a number?
store numerical data, money data
What is the purpose of a boolean?
one of two value true or false. Funtions
What does the = operator mean in JavaScript?
assign value to operator
How do you update the value of a variable?
What is the difference between null and undefined?
undefined - variable has not been defined
null-developer purposely assigned it to initialize variable and might get back to it. Like. a placeholder
Why is it a good habit to include “labels” when you log values to the browser console?
Make it easier to console.log things
Give five examples of JavaScript primitives.
string
number
bigint
boolean
undefined
symbol
null