Skip to the content.

Code 102: Class 2 Reading Notes

HTML & CSS - Jon Duckett

Chapter 3: Lists

Book direct quotes in quotations: Most content covered in Code 102

Ordered lists are lists where each item in the list is numbered.” Basically 1, 2, 3, and so on.

Unordered lists are lists that begin with a bullet point (rather than characters that indicate order).

Definition lists are made up of a set of terms along with the definitions for each of those terms.

You can also nest lists inside lists

New html code learned:

Defintion lists:

<dl> The definition list is created with the <dl> element and usually consists of a series of terms and their definitions.

Inside the <dl> element you will usually see pairs of <dl> and <dd> elements.

<dt> This is used to contain the term being defined (the definition term). <dd> This is used to contain the definition.

Chapter 13: Boxes

CSS steps on borders, margins, box sizes including how to customize min-width and max-width, paddings and margins.

*Centering is CSS can be tricky, so ch 13 is helpful as a good resource for images for example.

Information on inline, block, and inline-block, which so far those are probably my most used CSS properties I’ve used beyond ones such as color and font. Helpful for basic formatting for beginners.

Chapter Summary From Book

JavaScript - Jon Duckett

Chapter 2: Basic JavaScript Instructions

Overiveiw of the synta and grammar and how the browser runs the tasks

JavaScript is case sensitive. username and userName are different

STATEMENTS ARE INSTRUCTIONS AND EACH ONE STARTS ON A NEW LINE A statement is an individual instruction that the computer should follow. Each one should start on a new line and end with a semicolon.

The semicolon also tells the JavaScript interpreter when a step is over, indicating that it should move to the next step.

STATEMENTS CAN BE ORGANIZED INTO CODE BLOCKS

Some statements are surrounded by curly braces; these are known as code blocks. The closing curly brace is not followed by a semicolon

Comments explain what my code does, and also easy ot understand for others who read my code

New Knowledge:

MULTI-LINE COMMENTS To write a comment that stretches over more than one line, you use a multi-line comment, starting with the /* characters and ending with the * / characters. Anything between these characters is not processed· by the JavaScript interpreter. Multi-line comments are often used for descriptions of how the script works, or to prevent a section of the script from running when testing it.

SINGLE-LINE COMMENTS In a single-line comment, anything that follows the two forward slash characters I/ on that line will not be processed by the JavaScript interpreter. Singleline comments are often used for short descriptions of what the code is doing. Good use of comments will help you if you come back to your code after several days or months. They also help those who are new to your code.

Have to annouce and declare variables before using.

can use var or let

Data Types: (Also learned in lecture 5/10) Notes taken during lecture:

Types

Strings

Booleans

Undefined

Null

Const

If/Else

Am I hungry if yes - end statement

if no … start the chain: Am I hungry? no? am i thirsty? yes then drink water

JavaScript wording: if(this conditions evaulues to ture){execute this following code black}

//if false to being hungry {execute this action}

Basically it will keep reading top to bottom until the condition is met OR reach the end of the statement //

if(iAmHungry){ eat; else if(IAmThirsty) drink; } ekse { take a nap; }

Replit Notes

Comparison Operators

// === comparative equals “loosely equals” // ! means bang symbol != “loosely not equals’ OUR WORLD* === strictly equals !== stricty not equals

We want to learn by being very strict in the beginning.

<> less than, greater than <= less than/ or equal too => greater then or equal too

let a = 5;

console.log(a === 5); will run as true console.log(a === ‘5’); will run as false since it is a string not number console.log (a == ‘5’); will run loosely true, because it will see that it is loosely equal by looking under the hood and seeing that it is still a number even though under a string quote. Loosely equal to be avoided during the course for now, due to it being up to JS to intepret and can be upredicatable.

Logical Operators

&& - AND || - OR ! - NOT

Chapter 2 Summary:

Chapter 4: Decisions and Loops (up to switch statements)

EVALUATIONS You can analyze values in your scripts to determine whether or note they match expected results.

DECISIONS & LOOPS DECISIONS Using the results ofevaluations, you candecide which path your script should go down.

LOOPS There are also many occasions where you will want to perform the same set of steps repeatedly.

Switch Statements

A switch statement starts with a variable called the switch value. Each case indicates a possible value for this variable and the code that should run if the variable matches that value.

Things I want to know more about

Want to see more loops and switch in action to understand and practice.