unordered list
in your HTML document?
bullet style
of unordered list items?
type
as follows:
- `circle`
- `disc`
- `square`
ordered list
vs an unordered list
in your HTML document?
list items
provided by an ordered list
?
type
:
a
lowercase lettersA
uppercase lettersi
lowercase Roman numeralsI
uppercase Roman numerals1
number (default)margin
and padding
as characters in a story. What is their role in a story titled: “The Box Model”?
margin
is the whitespace between the box and other elementspadding
is the whitespace inside the box between the content
and the border
box model.
data types
can you store inside of an Array
?
people
array a valid JavaScript array? If so, how can I access the values stored? If not, why?
people[#][#]
to pick the array and item
people[1][0]
: Smithpeople[0][1]
: 32const people = [['pete', 32, 'librarian', null], ['Smith', 40, 'accountant', 'fishing:hiking:rock_climbing'], ['bill', null, 'artist', null]];
Name | Shorthand operator | Meaning |
---|---|---|
Assignment | x = f() | x = f() |
Addition assignment | x += f() | x = x + f() |
Subtraction assignment | x -= f() | x = x - f() |
Multiplication assignment | x *= f() | x = x * f() |
Division assignment | x /= f() | x = x / f() |
expression
and explain what the result would be and why.
10dog
a
is a number
and converted to a string
when concatenated with a string
c
is a boolean
value that is set to false
, so the value is 0
a
+ c
together (10 + 0), and thus returning 10
as the value to concatenate with dog
c
were set to true
, the output would change to 11dog
let a = 10;
let b = 'dog';
let c = false;
// evaluate this
(a + c) + b;
if
statement can be use anytime a decision needs to be made by the program based on prior inputs or dataCorrect!
or Incorrect!
based on if the answers match if (userAns == correctAns[i]) {
console.log('correct');
correctCount = correctCount + 1;
console.log(correctCount);
alert(`Correct! ${responseAlert[i]}`);
} else{
console.log('incorrect');
alert(`Incorrect! ${responseAlert[i]}`);
}
Loop
is useful in JavaScript.
Loops
are useful when you need to run the same code over and over againlet countDown = 10;
for (let i = countDown; i >= 0; i--) {
console.log(`Countdown: ${i}`);
} console.log('Blast Off!');
in-line
vs block