Skip to the content.

Code 102: Class 2 Reading Notes

HTML & CSS - Jon Duckett

Chapter 2: Text

Overview of previously covered content such as doing headings, paragraphs, formatting like bold, italics, emphasis semantic language

Semantic Markup

Interesting in that it is not used to change the way your website looks, but more to describe content. Example are screenreaders adding extra emphasis to <em> text

Chapter 10: Introducing CSS

CSS works by associating rules with HTML elements. These rules govern how the content of specified elements should be displayed. A CSS rule contains two parts: a selector and a declaration.

CSS helps style and format the look of website.

There is internal, inline, and external css

External is best practice.

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 loop 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.

Things I want to learn more about:

More CSS Selector practice and memorizing as many can with practie