JS Flashcards
What is the purpose of variables?
vairable stores data and runs it into scripts
How do you declare a variable?
var + name
How do you initialize (assign a value to) a variable?
=
What characters are allowed in variable names?
Num, string, boolean
What does it mean to say that variable names are “case sensitive”?
var keyword when called should match exact declaration
What is the purpose of a string?
storing text
What is the purpose of a number?
storing numerical values
What is the purpose of a boolean?
to see if a function should run or not (true or false)
What does the = operator mean in JavaScript?
Assignment operator
How do you update the value of a variable?
using var name and =
What is the difference between null and undefined?
null represents a non existent or invalid object, while undefined is a value assigned to a variable which doesn’t have an actual argument
Why is it a good habit to include “labels” when you log values to the browser console?
clarification
Give five examples of JavaScript primitives.
string, number, boolean, undefined, null
What data type is returned by an arithmetic operation?
math operations
What is string concatenation?
combining two string together