javascript Flashcards
What is the purpose of variables?
hold a value
How do you declare a variable?
var
How do you initialize (assign a value to) a variable?
=
What characters are allowed in variable names?
identifier must start with a letter, underscore ( _ ), or dollar sign ( $ ). Subsequent characters can also be digits ( 0 – 9 ).
What does it mean to say that variable names are “case sensitive”?
upper and lower case affects it
What is the purpose of a string?
useful for holding data as text
What is the purpose of a number?
primitive wrapper object used to represent and manipulate numbers
What is the purpose of a boolean?
true or false
What does the = operator mean in JavaScript?
assignment
How do you update the value of a variable?
FIND THE ANSWER
What is the difference between null and undefined?
undefined is a type, whereas null an object.
Why is it a good habit to include “labels” when you log values to the browser console?
to keep track of where you are
Give five examples of JavaScript primitives
string, number, bigint, boolean, symbol, undefined
What data type is returned by an arithmetic operation?
FIND THE ANSWER
What is string concatenation?
method concatenates the string arguments to the calling string and returns a new string.