JavaScript

JavaScript is the programming language of HTML and the Web.

JavaScript is easy to learn.

This tutorial will teach you JavaScript from basic to advanced.


Why Study JavaScript?

JavaScript is one of the 3 languages all web developers must learn:

  1. HTML to define the content of web pages
  2. CSS to specify the layout of web pages
  3. JavaScript to program the behavior of web pages

Web pages are not the only place where JavaScript is used. Many desktop and server programs use JavaScript. Node.js is the best known. Some databases, like MongoDB and CouchDB, also use JavaScript as their programming language.


JavaScript Documentation

Chapter 1: Introduction to JavaScript

  • What is JavaScript?
  • History and Evolution
  • JavaScript vs Other Languages
  • How to Add JavaScript to HTML
    • Inline Script
    • Internal Script
    • External Script
  • JavaScript Output (alert, console.log, document.write, innerHTML)

Chapter 2: JavaScript Basics

  • Syntax
  • Statements
  • Comments
  • Variables (var, let, const)
  • Data Types
  • Operators (Arithmetic, Assignment, Comparison, Logical)

Chapter 3: JavaScript Control Flow

  • Conditional Statements
    • if, else, else if
    • switch
  • Loops
    • for, while, do...while
    • break, continue
  • Ternary Operator

Chapter 4: JavaScript Functions

  • Function Declaration
  • Function Expressions
  • Arrow Functions
  • Parameters and Arguments
  • Return Statement
  • Scope (Global vs Local)

Chapter 5: JavaScript Objects

  • Creating Objects (Object Literals, Constructors)
  • Accessing Properties (Dot vs Bracket Notation)
  • Methods
  • this Keyword
  • Object Methods (Object.keys, Object.values, Object.entries)

Chapter 6: JavaScript Arrays

  • Creating Arrays
  • Array Indexing and Length
  • Common Methods:
    • push(), pop(), shift(), unshift()
    • splice(), slice()
    • indexOf(), includes()
    • map(), filter(), reduce(), forEach()

Chapter 7: JavaScript Strings

  • String Basics
  • Common Methods:
    • length, indexOf(), slice(), substring()
    • replace(), toUpperCase(), toLowerCase()
    • trim(), split(), concat(), includes()

Chapter 8: JavaScript Date and Time

  • Date Object
  • Getting and Setting Date Values
  • Formatting Dates
  • Time Methods

Chapter 9: JavaScript Math

  • Math Object and Methods
    • Math.round(), Math.floor(), Math.ceil()
    • Math.random(), Math.max(), Math.min()

Chapter 10: JavaScript Events

  • Introduction to Events
  • Event Handlers (onclick, onmouseover, etc.)
  • addEventListener()
  • Event Object (event.target, event.preventDefault())

Chapter 11: JavaScript DOM (Document Object Model)

  • What is the DOM?
  • DOM Tree Structure
  • Selecting Elements (getElementById, querySelector)
  • Manipulating Elements (innerHTML, style, classList)
  • Creating and Removing Elements
  • Traversing the DOM

Chapter 12: JavaScript BOM (Browser Object Model)

  • window Object
  • alert(), confirm(), prompt()
  • setTimeout(), setInterval()
  • navigator, screen, location, history

Chapter 13: JavaScript Forms

  • Accessing Form Elements
  • Form Validation (Basic)
  • Preventing Default Behavior
  • Submitting Forms with JavaScript

Chapter 14: JavaScript Error Handling

  • try...catch
  • finally Block
  • throw Statement
  • Custom Error Messages

Chapter 15: JavaScript ES6 and Beyond

  • let, const
  • Template Literals
  • Arrow Functions
  • Destructuring
  • Spread & Rest Operators
  • Default Parameters
  • Modules (import/export)
  • Classes and Inheritance

Chapter 16: JavaScript JSON

  • What is JSON?
  • Converting JavaScript to JSON and vice versa
  • JSON.stringify() and JSON.parse()
  • Working with APIs (Basic)

Chapter 17: JavaScript Promises & Async/Await

  • Introduction to Promises
  • .then() and .catch()
  • async and await
  • Handling Multiple Promises

Chapter 18: JavaScript Fetch API

  • What is Fetch?
  • GET and POST Requests
  • Working with JSON
  • Error Handling in Fetch

Chapter 19: JavaScript Storage

  • Local Storage
  • Session Storage
  • Using JSON with Storage

Chapter 20: JavaScript Projects and Practice

  • Mini Projects (e.g., To-Do App, Calculator)
  • DOM Practice Exercises
  • API Integration Practice
  • Form Validation Project

NOTE: We recommend reading this tutorial, in the sequence listed in the left menu. If you try all the examples, you will learn a lot about JavaScript, in a very short time!