Replace & Reformat with Captured Groups

Parts of matched strings be “captured” for later use using group parentheses (). Captured groups allows you to pull out patterns […]

Read More

Validation in JavaScript

User Can only contain letters in lowercase Password Can contain any character, but must contain at least one lowercase letter, […]

Read More

Regex in JavaScript

Create a Regular Expression Test & Replace Test example Replace example Flags i Case-insensitiveg Global; keeps searching for the regexm Multiline; considers the […]

Read More

Regular Expressions

A regular expression is a way to describe a pattern in a string. With regular expression you can use the […]

Read More

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