JavaScript Flashcards
What is a variable?
A variable is a container that stores data
Why are variables useful?
Variables can store data, and be used multiples times within code
What two special characters can a variable begin with?
$ and _
How do you declare a variable?
use the keyword “var”
How do you assign a value to a variable?
Use the “=”
Are variables case sensitive?
Yes
Which words cannot be used as variable names?
keywords such as function, console, etc
What is a string?
Form of data stored within quotation marks
What is the string concatenation operator?
’+’
What is the difference when it comes to using single or double quotes?
No difference
How do you use escape quotation characters?
need to put a “"
What is type coercion?
Type coercion is the process of converting one value to another type
What is a number in Javascript?
Any number
What is an arithmetic operator?
Any of the operators that perform arithmetic
Name four of the arithmetic operators:
- +
- -
- *
- /