Notes for Codefellows Code 401 301 201 and 102
3 types of html lists
<dl> <dt> <dd> CLOSING TAGS EACH
Lists can be nested inside each other
CSS treats each HTML element as if it has its own box; you can use CSS 2 control the dimensions of the box; U can also control the borders, margins, padding for each w CSS; You can hide elements using display and visibility properties AND opacity; block level boxes can b made inline and inline into block; legibility can be improved by controlling the width of boxes containing text; create image borders and rounded borders (love these);
Arrays store >1 value (lists of it);
colors = ['white', 'black', 'custom'];
var itemThree = colors[2]; index is calling the 3rd file from list;
var numColors = colors.length ----- returns how many items in the list
if (score > 50) {
alert('Congrats');
} else {
alert('you got this - try again');
}
switch statements allow you 2 compare a value against possible outcomes (and also provides a default option if none match); page 164
all values evaluate to either truthy or falsy; all values 0, empty, NaN, no assignment, or traditional false = falsey; traditional true, numbers, string w content, fractions, ‘true’, ‘0’, ‘false’(strings) = truthy;
for - when you know how many times the loop will run;
each repeats a set of statements;
for (var i=0; i < 10; i++) {
document.write(i+1);
} ======= 12345678910 - remember it starts at 0
loops consume resources - the interpreter stops loading the page and runs the loop- issues of slow page load; issues of infinite loop; variables inside the loop updated with each iteration - so keep as much of them outside the loop (if they dont need to be updated);