-
Unordered lists should be used to group a collection of items for which order does not matter.
-
The bullet style can be changed using the css property
list-style
. -
Ordered lists should be used to group a collection of items for which order does matter, e.g. rankings or directions.
-
The
type
attribute can change the numbering from numerals to letters or Roman numerals. Thereversed
attribute can make the numbers count down instead of up.
-
The margin is the military man, keeping other nations away. The padding is the police man, keeping his nation contained.
-
The parts of the css box model are
-
Content Box: The area where the content is displayed.
-
Padding Box: The space between the content and the border.
-
Border Box: Marks the outside of the box.
-
Margin Box: The space between the border and any other elements.
-
-
You can store any type of data in an array, including numbers, strings, objects, or arrays.
-
It is valid, and values are accessed by chaining indexes; for example the value
'accountant'
is accessed bypeople[2][3]
. -
In the last, note that it does not assign if x is not truthy, short-circuiting the evaluation.
Name Shorthand Operator Description Addition assignment x += y
x = x + y
Division assignment x /= y
x = x / y
Remainder (modulus) assignment x %= y
x = x % y
Exponentiation assignment x **= y
x = x ** y
AND assignment x &&= y
x && (x = y)
-
Adding a false boolean to a number is just adding 0, so
10 + false
is10
. Adding anything to a string concatenates it to the string, so the whole expression(10 + false) + 'dog'
evaluates to'10dog'
. -
When the browser loads a page, could check whether the user has dark mode turned on. If they do, then the page would load a dark color scheme; otherwise, it would load a light color scheme.
-
A loop would be needed if you want to use a function to process each item in an array.
I am a bit confused by objects right now, but seeing as we've not really done anything with them yet and I've only seen reference to them in passing, I am just going to have patience for the time being.