Professional Documents
Culture Documents
Basics of JavaScript
Giving instructions to a computer using code, running code, modifying webpages,
and understanding the language.
Order of Operations
Calculating 10% tax and cost of products using order of operations. Multiplying
before adding to get accurate results.
Explains how to use brackets to control the order of operations when calculating
numbers in JavaScript. Also explains why computers have trouble accurately storing
some floats.
Escape characters are special characters that start with a backslash and are used in
strings. They create a character that is just text and does not start or end strings.
Examples include the new line character and slash single and double.
HTML Basics
Instructions to a computer to create a button and paragraph of text. Syntax rules for
HTML elements, such as starting with a less than symbol and element name.
CSS Basics
Reviews the basics of HTML and CSS syntax, including how to write CSS code
inside HTML files, how to change the appearance of elements, and syntax rules.
CSS Syntax and HTML Attributes
Review of CSS syntax and introduction to HTML attributes to style elements
differently. Explains syntax rules for attributes and class attribute to label elements.
HTML Structure
VS Code Setup
Update tab size and indent settings to use two spaces per indent. Shortcuts to add
and remove indents.
VS Code Setup
Adjust indents and enable line wrapping in VS Code for better code readability.
Combines HTML, CSS, and JavaScript to create interactive websites. Can run
JavaScript code in script element or on click attribute. Comments provide more info
for readers and can be used to comment out code.
Using slash star and star slash for multi-line comments, double slash for single line
comments, and console.log to display results back in the console.
Learning Variables
Review basics of HTML and CSS, set up code editor, learn how to use script element
and on click attribute, create comments, use console.dot.log, learn about variables
and create first variable.
Learn how to create variables in JavaScript, including syntax rules and the use of
semicolons.
Reassigning Variables
Changing the value saved inside a variable by typing the variable name and a new
value. Syntax does not include the word "let". Can be done multiple times.
Creating a new HTML file and copying code from another file to build a simpler
version of the cart quantity feature, increasing the quantity by one, two, or three when
the respective buttons are clicked.
Creating Buttons
Creating buttons in HTML and making webpage interactive with JavaScript, including
creating a variable to save cart quantity and using on click attribute to display
message in console.
Naming Conventions
Camel Case, Pascal Case, Kebab Case, and Snake Case are all naming
conventions used in programming. JavaScript uses Camel Case for variable names
and Pascal Case for certain features.
Learn 3 ways to create variables in JavaScript: let, const, and var. Const creates a
variable that can't be changed later, while let and var can be changed. Best practice
is to use const by default.
Variables in JavaScript
Learn about variables, reassigning, naming conventions, and 3 ways to create
variables (let, const, var).
Bullying Values
Boolean values are true or false and represent whether something is true or false.
Comparison operators can be used to create boolean values. Double equals and
triple equals are two ways to check if two values are equal.
Comparison Operators
Comparing values in JavaScript using double and triple equals, and understanding
the order of operations.
Learn how to write code to compare two values and decide which code to run.
Syntax rules for if statements and optional else statement discussed.
Logical Operators
Combines two boolean values to check if both are true. Used in project to check if
random number is between zero and one third.
Logical Operators
Using if/else statements to check for conditions and logical operators to evaluate
true/false values.
Turnery Operator
A shortcut for an IF statement that saves the result of the first value (truthy/falsey) in
a variable.
Guard Operator
An AND operator that stops early if the left side is falsey, blocking the code on the
right.
Shortcutting IF Statements
Learned about boolean values and how they can be used as shortcuts for IF
statements like the OR operator and the Default operator.
Using Functions
Learn how to use functions to reuse code, create a new file and open it in the
console, create a function with a name and code, and use the function name with
brackets to run the code.
Creating a Function
Writing code to reuse by creating a function, giving it a name, and putting code in the
body.
Functions create a scope that limits where a variable exists. Global variables can be
accessed anywhere and are used to solve the problem of code not running outside of
the function.
Using return statements to get a value out of a function, and saving the return value
in a new variable to prevent conflicting with variables outside the function's scope.
Parameters in Functions
A parameter lets us put a value into a function and use it just like a variable. We can
pass a value into the function, which is also called an argument. We have used
functions and parameters this whole time.
Parameters in Functions
A function can have multiple parameters, which can be given default values.
Parameters are only available within the function's scope and can be used to
substitute values in the code.
Objects in JavaScript
Objects group multiple values together. We can access specific values in the object
using properties. We can also use objects to create a score in our rock paper
scissors project.
Objects in JavaScript
Access, change, add, and remove values from an object using dot notation. Syntax
rules for objects include open and closed curly brackets, property-value pairs
separated by a colon, and multiple values separated by a comma.
Creating a copy of the rock paper scissors game from the previous lesson and using
objects to keep track of the score when playing the game. Resetting the score back
to zero when the reset score button is clicked.
Updating Score
Create a variable outside of a function to save score. Update score with an if
statement if result is a win. Increase wins property in score object by one.
Converting algorithm to code to update score and display it in popup using template
strings and multi-line strings.
Accessing values, functions, and methods in objects using dot or bracket notation.
Examples of built-in objects such as console and math.
Local Storage
Retrieve and store values in local storage using the get item and set item methods.
Convert objects to strings using JSON.stringify and strings to objects using
JSON.parse.
Auto Boxing
Strings and other values can have properties and methods, which is enabled by auto
boxing, a feature that automatically wraps the value in an object.
Copy by Reference
When creating objects, the actual value is created in memory and the variable just
gets a reference that points to that location. This makes the language more efficient
by not copying the entire object.
Destructuring Shortcut
Taking properties out of an object using comma and variable.
Shorthand Property
Substituting variable into code for same property and variable name.
Shorthand Method
Writing function without function name for same code.
The document object is linked to the webpage. It contains properties and methods
that can be accessed using dot notation, which can be used to change the webpage.
Selecting Elements
Using document.querySelector, we can get any HTML element from the page and
control its inner HTML. We can also select elements with a class attribute by typing a
dot in front of the class name.
Using the DOM, we can get HTML elements from the page, put it inside our
JavaScript and then save it in a variable. CSS is used to style elements with a
specific class. We can use the DOM to create projects that modify the webpage.
Using event listeners to check for events and run JavaScript when those events
happen. Checking if key pressed is enter, and if so, running same code as calculate
button. Cleaning up code by moving it into a function.
Window Object
JavaScript built-in object that represents the browser and allows access to the
document object model.
Styling Text
Creating a feature to style the text on the page by changing the body element.
Using font-family, margin, padding, and font-size properties to style text and
elements.
Using CSS to style HTML elements, such as a title, buttons, and images.
Organizing Files
Creating a folder to organize images and using file paths to tell the computer where
to look for them.
Organizing Code
Separating JavaScript, HTML, and CSS into their own files to make code cleaner and
easier to read.
Separating Code into Files
Learned how to use script and link elements to separate HTML, CSS, and JS into
their own files for easier readability.
Creating an Array
Learn to create an array in JavaScript and save it in a variable. Console log the
variable to display the list of values.
Arrays in JavaScript
Lists of values that can be accessed and changed using square brackets. Can
contain any type of value and can be stored in variables or other arrays.
Understanding Arrays
Learn how to check if something is an array, use the .length property and .push
and .splice methods.
Learn how to use JavaScript to create a to-do list project that adds items to an array
and displays them in the console. Also learn how to use loops to display the items on
the page.
Looping Basics
Comparing two types of looping and when to use each. Explaining a non-standard
loop and looping through an array.
Looping through an array of strings to generate HTML code, combining the code
together, and then putting it on the webpage using the DOM.
Using the diviv element, JavaScript code is used to render HTML on the page. The
diviv element is a block element that takes up an entire line and does not add extra
space above or below. A function is created to render the HTML on the page every
time a to-do is added.
Creating the second version of the to-do list project by looping through an array and
generating the HTML using JavaScript. Adding a delete button to each to-do item
and reformatting the HTML to make it easier to read.
Arrays as References
Arrays are references, so if one is modified, the other is too. To avoid this, use the
slice method to make a copy of the values.
Destructuring
A shortcut to get values out of an array and save them in a variable.
Loops
Break lets us exit a loop early, while continue lets us skip one iteration.
Creating a copy of an array where each number is doubled using loops and
functions.
Advanced Functions
Reviewing how to use functions inside the script element and learning an advanced
feature of functions, that they are values and can be saved in variables.
Functions as Values
Functions are values that can be saved in variables and objects. They can be called
using brackets, and their syntax is a shortcut for anonymous functions. Hoisting
doesn't work when functions are saved in variables.
Asynchronous Code
Computer won't wait for one line to finish before going to the next line. Set timeout
sets up a timer and after a certain amount of time it will call a function. Advantage is
that it doesn't block code while timer runs in background.
Asynchronous Code
Using setTimeout and setInterval functions to run a function after a certain period of
time.
Loop through array of to-do list and use a forEach method with two parameters. First
parameter contains each value in the array, second parameter contains each index
of the value. Make a copy of the files and change the CSS and JavaScript file loaded.
Shortcut for writing functions, recommended for passing into other functions.
Examples given of rock paper scissors game and to-do list project.
Using document.querySelectorAll to get a list of elements with the same class, then
looping through them with forEach to add event listeners.
Closures
A closure is a feature of functions where a value is packaged together with the
function, allowing the function to always have access to that value.