reading-notes

These are my reading notes for Code Fellows


Project maintained by taegorov Hosted on GitHub Pages — Theme by mattgraham

Home

Reading Notes Code 201: Day 2

Notes - Chapter 2: “Text” (pp.40-61)

Structural Markup Cheatsheet:

The following need closing tags (</p>, for example) unless otherwise indicated

Semantic Markup Cheatsheet:

The following need closing tags (</p>, for example) unless otherwise indicated

These differ from structural markup because they describe the content vs. just adding style (like italics), although they sometimes add style (like italics) as well

Notes - Chapter 10: “Introducing CSS” (pp.226-245)

article {color: black;}

External vs Internal CSS
Types of Selectors

There are various ways to apply styling to an element of your page. This includes Universal Selectors(* {}), Class Selectors (.h1 {}), and ID Selectors (#stylizedh1).

Notes - Chapter 2: “Basic JavaScript Instructions” (pp.53-84)

Statements

A script is like a step-by-step instruction of how to tie your shoes (or any other set of instructions). Each step (e.g., “cross each lace”) is a statement.

Statements end with a ;

{ and } are the start and end of a code block.

Each statement starts on a new line

Comments

/* Type comments to yourself using this structure */

// you can use the double forward slash for single-line comments //

Like with HTML and CSS, these will help others understand your code better (and help you when you look back at your code months down the road)

Variables

These are just like variables in math or logic, which are “calculated or computed”

Declare a variable like so:

var quantity;

Assign a value to a variable like so:

quantity = 3;

Data Types

You can multiply/add/subtract/etc. variables using just their names, provided you have provided a value (see Data Types) to your variable

Variable Shorthand

There are many ways to de-clutter (or simplify) creating a variable. One option is shown below:

var price = 5;

instead of

var price;

price = 5;

Arrays




Expressions

Essentially 2 types of expressions:

  1. Assign a value to a variable
  2. Combine values of different variables to create another (single) variable

Operators

Depended on by expressions

Assignment Operator

color = 'red';

Arithmetic Operator

area = 5 * 10;

String Operator

greeting = 'Yo' + 'Timbo';

Comparison Operator

Cheese = 10 > 20;

Logical Operator

Cheese = (10 > 20) && (2<8>);

There are many arithmetic operators that you might recognize from math class, but some are doubled up (like ++ or --).

Page 76 of Jon Duckett’s JavaScript & JQuery lists some of these operators


Notes - Chapter 4: “Decisions and Loops” (pp.145-162)

only up to the section on switch statements

== IS EQUAL TO

!= IS NOT EQUAL TO

=== STRICT EQUAL TO

!== STRICT NOT EQUAL TO

> GREATER THAN

< LESS THAN

>= GREATER THAN OR EQUAL TO

<= LESS THAN OR EQUAL TO


Logical Operators

The below are Logical Operators:

&& is a Logical And

|| is a Logical Or

! is a Logical Not


Loops

A code block will run repeatedly (in a loop) until it returns the condition of false.

for runs a code a certain number of times

while code will continue to run as long as a condition is true

do...while like while, with some caveats


Loop Counters