Software Engineer & Educator
Course Description
Take your first steps into the wide world of JavaScript and walk away with the core skills needed to become a professional JavaScript programmer! Through a series of hands-on projects, you'll learn the building blocks to write dynamic websites. Modify web pages on the fly, write reusable code with functions, react to user events, make decisions with conditionals, and fetch data from APIs! Everything you need to continue your journey to become effective at JavaScript.
Preview
Table of Contents
Introduction
Section Duration: 28 minutes
Anjana Vakil introduces the course by providing some personal background and answering a student's questions regarding how Anjana discovered JavaScript and why they like it.
Anjana provides an overview of the material covered in the course, including the DOM, data types, arrays, objects, functions, events, branches, loops, fetching data, and real-world JavaScript. A student's question regarding how much time will be spent writing code is also covered in this segment.
Anjana discusses what JavaScript is and what it can do some examples include the language of the web, a programming language, and something that lets people modify and add functionality to a website.
Anjana discusses the relationship between HTML, CSS, and JavaScript and the places JavaScript can be written. The browser's JavaScript console, local text files in editors, and online playgrounds are some examples discussed. A brief demonstration of using the console is also provided in this segment.
DOM
Section Duration: 1 hour, 12 minutes
Anjana walks through what an HTML document looks like by drawing out a tree of HTML elements and briefly discussing the elements contained in the provided example.
Anjana demonstrates how to use the web browser's inspect tool to find specific HTML elements and their contents on a webpage. Discussions regarding using various selector syntaxes, including querySelector, getElementsByTagName, and querySelectorAll to query for particular details, are also covered in this segment.
Anjana discusses getting the number of matching elements using the .length selector and the text contained in an element using .textContent Student questions regarding the difference between an HTML collection and a node list and why it is .length and not .count are also covered in this segment.
Anjana walks through an exercise using console commands to find all the p elements, the text "X," the number of squares on the board, and the text "A game you know."
Anjana demonstrates using JavaScript commands in the web browser console to edit the HTML and CSS of a web page. The changes made with console commands will revert to the original page view when the page refreshes.
Anjana walks through an exercise of using the console to edit the webpage HTML. This exercise includes changing the player names, swapping the player symbols, and changing the subtitle to "A game you know and love."
Values & Data Types
Section Duration: 57 minutes
Anjana demonstrates the different values and data types used in JavaScript, including how to tell the type difference between "24" and 24. Primitive data types include string, number, boolean, undefined, null, bigint, and symbol.
Anjana provides an exercise to practice determining the value type in JavaScript. A demonstration of using typeof to check value types is also covered in this segment.
Anjana discusses the data type string, what strings are composed of, how to determine the length of a string, and demonstrates how characters are organized in a string.
Anjana demonstrates searching for the first occurrence of a specified string, substring, or character using the indexOf method. Also covered in this segment are includes, startsWith, toLowerCase, and how to combine two strings.
Anjana provides an exercise to practice inserting strings, searching for the first occurrence of a character, searching for the existence of a string in a document, and manipulating the case of strings.
Operators
Section Duration: 27 minutes
Anjana discusses the various operators and the different effects they can have on values in JavaScript. In JavaScript, Arithmetic operators respect the order of operations and can be grouped using parentheses.
Anjana provides an exercise to practice using arithmetic operators, including, addition, subtraction, multiplication, and division.
Anjana demonstrates JavaScript returning a boolean when running comparison operators and discusses the differences between the triple equals === and double equals == equality operators. A brief exercise using equality operators is also provided in this segment.
Expressions
Section Duration: 1 hour, 9 minutes
Anjana discusses what expressions are and where they can be used in JavaScript. An expression is a valid set of literals, variables, and operators that resolve to a single value.
Anjana demonstrates JavaScript's ability to remember values by declaring and assigning them as variables. A student's question regarding why `let bankruptcy` evaluates to undefined and not null is also covered in this segment.
Anjana briefly discusses the difference between the const and let keywords, how to utilize a variable, and demonstrates various naming conventions for variables.
Anjana provides an exercise to practice declaring and assigning variables and discusses a student's question regarding the difference between the let, const, and var keywords. Students are instructed to declare and assign variables to remember their name, the combined age of their parents, and the #board element on the Tic Tac Toe page.