JavaScript Primitives and Variables Flashcards
What is the purpose of variables?
hold value
How do you declare a variable?
by placing the var in front of the ‘name of variable’
How do you initialize (assign a value to) a variable?
using the = operator
What characters are allowed in variable names?
letters, numbers, underscores, and dollarsigns
What does it mean to say that variable names are “case sensitive”?
the letters for e E and different variables
What is the purpose of a string?
storing and manipulating text
What is the purpose of a number?
preforming computations on data values in your field
What is the purpose of a boolean?
declare the variable true false, essentially yes or no
What does the = operator mean in JavaScript?
used to preform operations on values and variables
How do you update the value of a variable?
by using operators that can manipulate the original variable such as +=, -=, *= and /=
What is the difference between null and undefined?
null= intentional absence of the value and undefined is the value does not exist in the computer
Why is it a good habit to include “labels” when you log values to the browser console?
to tell what we console.log and remove confusion overall
Give five examples of JavaScript primitives.
string, number, boolean, null and undefined