javascript Flashcards
What is the purpose of variables?
The purpose of variables is to store data
How do you declare a variable?
var
How do you initialize (assign a value to) a variable?
=
What characters are allowed in variable names?
letters numbers dollarsign and number not at beggining
What does it mean to say that variable names are “case sensitive”?
variables with different cases are different variables
What is the purpose of a string?
The purpose of a string is to store text data
What is the purpose of a number?
The purpose of a number is to store numbers, and perform math.
What is the purpose of a boolean?
The purpose of a boolean is to denote if something is true or false
What does the = operator mean in JavaScript?
the equals operator assigns a value to a variable
How do you update the value of a variable?
You update the value of a variable by using the = sign
What is the difference between null and undefined?
null is assigned on purpose, undefined is not assigned on purpose
What is string concatenation?
The operation of combining strings into one single string
What data type is returned by comparing two values (,===,etc)?
Boolean
What does the += “plus equals” operator do?
It adds a value to a variable. It acts as a shorthand for var = var + value
What are objects used for?
For storing different but related pieces of data, and functions to perform operation on related data.
What are object properties?
Object properties are variables belonging to an object
Describe object literal notation.
Object literal notation is a way of defining an object in javascript.
How do you remove a property from an object?
the delete operator
What are two ways to get or update the value of a propery?
bracket notation and dot notation
What are arrays used for?
Arrays are used for storing data in an indexed format
Describe array literal notation
Array literal notation is a way to describe arrays in your code
How are arrays different from “plain” objects”
Arrays are indexed
What number represents the first index of an array?
0
What is the length property of an array?
it gives the number of values in the array