Javascript Primitives And Variables Flashcards
What is the purpose of variables?
to store information to be called upon later
How do you declare a variable?
var (name) = (value)
How do you initialize (assign a value to) a variable?
=
What characters are allowed in variable names?
Letters, numbers, & underscore (_)
What does it mean to say that variable names are “case sensitive”?
to use the variable you need to use the exact spelling and casing of the variable.
What is the purpose of a string?
To hold text content
What is the purpose of a number?
to hold a numerical value
What is the purpose of a boolean?
a decider factor
What does the = operator mean in JavaScript?
to assign to
How do you update the value of a variable?
reinitialize it
What is the difference between null and undefined?
undefined is unusable space
null is a fillable blank space
Why is it a good habit to include “labels” when you log values to the browser console?
It helps identify what is going on/whats being used