Callbacks with Arguments

This is how you can pass an argument to a call back that takes one. An example using addEventListener: Remember that […]

Read More

Timers

One-Off Timers with setTimeout Where callback is a function and delay is the number of milliseconds until the callback is invoked. Repeat Timers with setInterval Where callback is […]

Read More

Anonymous Functions

An anonymous function is a function without a name.Converting sayHello() function into an anonymous function: Becomes: This is also know as inlining […]

Read More

Intro to Callback Functions

Function vs Callback Function Callbacks are just functions, but instead of being called by the programmer explicitly, they are called […]

Read More

DOM Scripting By Example

Submit & Change Events event.preventDefault()Is called on the event object to keep the browser’s default behavior from occurring in response […]

Read More

DOM Traversal

Traversal is selecting an element based on its relationship to another element within the DOM. Remove Element – Exploring Parents […]

Read More

Listening for Events

The method addEventListener() is a function that takes a function as an argument.You can use addEventListener() to listen for events. addEventListener() takes […]

Read More

Event Listening Foundation

Functions as Parameters Functions are called “first-class citizens” in JavaScript because they can be stored in variables or passed into […]

Read More

Creating New DOM Elements

Create Element document.createElement() creates an element – without adding to the DOM. Append Element Child Node.appendChild() selects an existing node, then appends […]

Read More

Change DOM Elements

Element.textContent Gets and sets text inside an element. Get value Set value Same as: Element.innerHTML Gets and sets HTML code […]

Read More

DOM: Document Object Model

Document = WebpageObject = Elements of a programModel = Way of thinking about things DOM is a way to describe […]

Read More

Basic Arrow Syntax

Function Expression vs Arrow Function Expression Concise Arrow Function Expression Before After Function Types Comparison

Read More

Template Literals

Template literals are very similar to string literals, but they use backticks (`) instead of single quotes (’) or double […]

Read More

Variable Declaration

Old var pi = 3.14159; New const pi = 3.14159; let radius = 5; Const Short for constant – constant […]

Read More

Commenting

Below are various ways of neat commenting:

Read More

‘use strict’ Statement

What Is It? It is not a statement, but a literal expression that defines that JavaScript code should be executed […]

Read More

JSON & Object Literals

Array of Objects OR JSON – JavaScript Object Notation Because JavaScript objects provide a structured way to store data, JavaScript […]

Read More

Object Literal

Sometimes called an object for short. A JavaScript object literal is like a series of named variables, each with their […]

Read More

Arrays

Define Add & Remove 1. Assign – Assigning a value 2. Push – Adding to the end of the array 3. Unshift – […]

Read More

Loops

While Loop Loop condition is evaluated before loop start. Auto-guess a number between 1-10000 Do-While Loop Loop condition isn NOT […]

Read More