Primative Data Types Flashcards
1
Q
Name the 6 Data Types
A
- Numbers
- Strings
- Boolean
- null
- undefined
- object
2
Q
Variable
A
Placeholder for values to be used by the program.
3
Q
=
A
Assignment operator
4
Q
document.write()
A
• write something to the HTML document
5
Q
string
A
- Words or characters that are contained in quotation marks “ “
- used for text
6
Q
Comments
A
// comment a single line /* comment multiple lines */
7
Q
Two main number types
A
- Integer - whole numbers without decimal point
- float - decimals
- Many languages categorize both as two separate types.
8
Q
Expression
A
Any reference to a variable or value, or a set of variables and values combined with operators
9
Q
Statement
A
In a computer language, a group of words, numbers, and operators that perform a specific task
10
Q
Operators
A
Perform actions on values and variables.
11
Q
Static typing
A
- A variable that can only hold a specific data type. e.g. number or string not either.
- Also known as strict enforcement.
12
Q
Dynamic typing
A
A variable that can hold any type of value at a time.
13
Q
Constant
A
- variable who’s values doesn’t change
- they are declared with all caps and underscores instead of camilCase for normal variables.
- declared at the top of a program.
- ES6 allows declaration with “const” instead of var
14
Q
Block
A
- a sequence of statements wrapped in braces { }
- typically seen with conditionals and loops but doesn’t have to be.
- doesn’t need a semicolon
15
Q
Undefined
A
- Variable that has no value or not in existence
- JavaScript will return undefined if it does not have a value for something.
- you will see undefined if you create a variable and don’t set a value