Table of Contents
JavaScript Basics
-
Introduction
Brian Holt introduces himself, and sets expectations for the next section. -
JavaScript Overview
Brian starts with the basics of JavaScript syntax. -
Semicolons and Q&A
Brian discusses the usage of semicolons and the choice of 'var' versus 'const' and 'let' in JavaScript code. -
Coding Conventions
Brian introduces JavaScript coding conventions, which is syntax that isn't necessarily required by the language, but makes code more readable to other programmers. -
Writing Your First JavaScript
Brian opens up VSCode and walks students through writing their first snippet of JavaScript code. -
Developer Tools Console
Brian demonstrates how to test code using console.log and the developer tools console inside of a browser
Primitives
-
Strings
Brian introduces the string primitive data type. -
Template Strings
Brian explains how to display JavaScript variables in strings using backticks instead of single or double quotes. -
Booleans
Brian introduces booleans, which are how true and false are handled in JavaScript. -
Numbers
Brian introduces the number primitive data type and gives a few things to watch out for when handling numbers.
Control Flow & Loops
-
Control Flow
Brian introduces the concept of control flow, the order in which individual statements are evaluated. -
Equality Comparisons
Brian demonstrates usage of the strict equality operator. -
If Statement
Brian begins implementing control and equality operators to carry out logic, starting out with an if statement and expression. -
Else If Statement
Brian codes an 'else if' statement into the 'if' statement, an additional condition for determining evaluated statements. -
Loops
Brian demonstrates how to implement a 'while' loop. -
Adding Comments
Brian demonstrates how to insert comments into JavaScript code. -
Incrementing
Brian gives examples of various ways to increment values in JavaScript. -
Incrementing in Loops
Brian uses what was learned in the previous lesson to demonstrate how a 'for' loop is executed. -
Looping Exercise
Students are instructed to to write a loop that prints a concatenated string to the console. -
Looping Solution
Brian demonstrates one way of coding the solution.
Functions & Scope
-
Functions & Parameters
Brian illustrates examples of functions in JavaScript and highlights key syntax details. -
Scope
Brian introduces how scope makes functions useful in JavaScript. -
Scope Examples
Brian walks through several examples where scoping rules affect the outcome. -
Experimenting with Scope
Brian alters positions of variable references and declarations to help explain how scope affects outcomes.
Builtins
-
Builtins
Brian introduces builtins by teaching students how to utilize MDN as a valuable resource. -
Math & substr
Brian introduces additional commonly used math and string manipulation builtins.
Quiz Exercise
-
Quiz Exercise
Students are instructed to construct quiz questions using JavaScript that implement functions, builtins, and other concepts learned so far. -
Abstract Comparison
Brian covers usage of the double equals comparison operator in JavaScript. -
Quiz Exercise Solution with Strings
Brian live codes the solution to the exercise involving string manipulation. -
Quiz Exercise Solution with Numbers
Brian live codes the solution to the exercise involving mathematical operations.
Objects & Arrays
-
Objects
Brian introduces the object data structure in JavaScript. -
Context
Brian explains the behavior of the 'this' keyword and related errors that commonly occur. -
Global Objects
Brian demonstrates usage of global objects, specifically the window object in the browser. -
Arrays
Brian introduces the array data structure in JavaScript. -
Array Methods
Brian delves into the methods that can be used to manipulate array data. -
Types and Q&A
Brian mentions that types can be declared using TypeScript, and answers questions about the section so far. -
Looping Over Arrays
Brian walks through the process of looping over the elements in an array. -
forEach Method
Brian codes a 'forEach' statement, and explains how to use a function as an input. -
map Method
Brian codes a map function and explains its usefulness. -
sort Method
Brian demonstrates usage of the sort function and introduces arrow functions. -
Array Methods Q&A
Brian discusses filtering and equality comparison in reference to array methods. -
And & Or Operators
Brian introduces && and || comparison operators for use in control flow statements.
Testing Exercise
-
Introduction to Testing
Brian explains what development tests are and why they are important when writing JavaScript code. -
Testing Exercise
Brian demonstrates how to make a test pass, and students are instructed to do the same with the remaining tests. -
Testing Solution with Arrays
Brian live codes the array traversal section of the solution. -
Testing Solution with Objects
Brian live codes the two object array sections of the solution. -
Readability and Performance Q&A
Brian fields questions from students about code readability and performance in relation to previously learned methods. -
Testing Solution with sort
Brian live codes the sort section of the solution, giving various ways to succeed in solving the same problem.
The DOM
-
Introduction to the DOM
Brian introduces the DOM by explaining the parts that make up a webpage. -
Interacting with the DOM
Brian provides instruction on how to work with CSS classes and IDs. The browser developer tools are also examined. -
Looping Over Query Results
A question is asked about how to use querySelectorAll to select multiple elements in the DOM and loop over them. -
Interacting with a Webpage
Brian outlines ways of interacting with a webpage through modifying classes on elements. -
Events & Listeners
Brian introduces events and listeners, which make webpages interactive. Screen readers are also discussed. -
Keyup Event
Brian introduces the event that occurs directly after a keyboard key is released, and gives potential use cases. -
Event Delegation
Brian defines event delegation, and emphasizes its usefulness through a code example.