JavaScript Quiz Questions Flashcards
(76 cards)
What is a variable?
A container for storing data
Why are variables useful?
You can reuse them, assign value to them, use for dynamic operations
What two special characters can a variable begin with?
A $sign or _underscore
How do you declare a variable?
The ‘var’ keyword
How do you assign a value to a variable?
with the equals sign
Are variables case sensitive?
Yes
Which words cannot be used as variable names?
other keywords in JS
What is a string?
A series of characters stored within a pair of “” marks
What is the string concatenation operator?
+ sign
What is the difference when it comes to using single quotes or double quotes ( ‘ ‘ or “ “ )?
No difference, but you can use apostrophes in “ “ double quotes.
How do you escape quotation characters?
With a backslash
What is type coercion?
The process of converting one data type value to another
What is a number in JavaScript?
a primitive datatype
What is an arithmetic operator?
operators that do math
Name four of the arithmetic operators?
+, -, *, /, %
What is the order of execution?
PEMDAS
What is a boolean?
A datatype with the values of true or false
What is a comparison operator?
Compares two values and returns a true or false value
What is the difference between undefined and null?
Undefined is a variable that has been declared but no value has been assigned.
Null must be assigned and is an empty value.
What advantages do you see with using a grid system?
Eliminates a lot of repetition, can be saved for later use,
More organized, and segmented.
Why are media queries crucial to responsive grid designs?
Allows for the page to be viewed on various device sizes so that nothing is cut out or removed due to sizing changes.
What is a function?
A list of actions to be performed
Why are functions useful?
Can be reused for multiple purposes, so they save a lot of time
How do you call a function?
name of the function with () parenthesis