JavaScript Runtime

Node.js — Complete Tutorial

Learn Node.js from absolute zero and build real backend skills: scripts, APIs, Express, deployment basics, and security fundamentals.

🟩 Beginner Friendly 🔧 Build APIs 📚 25 Topics
Your Progress3% complete
🚀Before you start

If you are new to JavaScript, learn the basics first (variables, functions, promises). Node.js uses JavaScript, but runs it on the server.

  • 1Install Node.js LTS
  • 2Create a project with package.json
  • 3Build a simple API and deploy
∙ Chapter 01

What is JavaScript?

JavaScript makes pages interactive through logic and events.

js-intro.php
📝 Edit Code
👁 Live Preview
💡 Click Run Test in preview.
Chapter 02
∙ Chapter 02

JS Syntax

Statements, expressions, and blocks form JavaScript syntax.

js-syntax.php
📝 Edit Code
👁 Live Preview
💡 Change values then run.
Chapter 03
∙ Chapter 03

JavaScript Variables

Variables hold runtime values using const/let/var.

js-variables.php
📝 Edit Code
👁 Live Preview
💡 Try visits += 2 and rerun.
Chapter 04
∙ Chapter 04

JavaScript Data Types

Type awareness prevents bugs and invalid operations.

js-types.php
📝 Edit Code
👁 Live Preview
💡 Try adding function or symbol values.
Chapter 05
Chapter 06
∙ Chapter 06

JavaScript Functions

Functions encapsulate reusable logic blocks.

js-functions.php
📝 Edit Code
👁 Live Preview
💡 Change function logic and rerun.
Chapter 07
∙ Chapter 07

JavaScript Arrays

Arrays are key for list processing in apps.

js-arrays.php
📝 Edit Code
👁 Live Preview
💡 Try nums=[] to test edge case.
Chapter 08
∙ Chapter 08

JavaScript Comments

Comments explain intent for maintainers.

js-comments.php
📝 Edit Code
👁 Live Preview
💡 Comments aid readability, not execution.
Chapter 09
∙ Chapter 09

JavaScript Objects

Objects hold structured app data.

js-objects.php
📝 Edit Code
👁 Live Preview
💡 Edit object keys and values.
Chapter 10
∙ Chapter 10

DOM Basics

DOM APIs connect state and interface.

js-dom.php
📝 Edit Code
👁 Live Preview
💡 Use querySelector/getElementById and re-test.
Chapter 11
∙ Chapter 11

JavaScript Events

Events capture user interactions and trigger logic.

js-events.php
📝 Edit Code
👁 Live Preview
💡 Type in input to test event flow.
Chapter 12
∙ Chapter 12

Conditions & Loops

Conditionals and loops control logic flow.

js-logic.php
📝 Edit Code
👁 Live Preview
💡 Change score values and rerun.
Chapter 13
∙ Chapter 13

ES6 Features

Modern syntax improves readability and consistency.

js-es6.php
📝 Edit Code
👁 Live Preview
💡 Try object rename and rerun.
Chapter 14
∙ Chapter 14

Async JavaScript

Async/await handles delayed operations cleanly.

js-async.php
📝 Edit Code
👁 Live Preview
💡 Adjust delay and re-run.
Chapter 15
∙ Chapter 15

Closures & Scope

Closures keep access to outer scope after execution.

js-closures.php
📝 Edit Code
👁 Live Preview
💡 Test each counter independence.
Chapter 16
∙ Chapter 16

Promises & Fetch

Fetch retrieves API data; promises handle async lifecycle.

js-fetch.php
📝 Edit Code
👁 Live Preview
💡 Try invalid URL to test catch block.
Chapter 17
∙ Chapter 17

JavaScript Best Practices

Modular, testable code reduces bugs and improves maintainability.

js-best-practices.php
📝 Edit Code
👁 Live Preview
💡 Keep functions single-purpose and testable.
Chapter 18
∙ Chapter 18

this & Binding

In JavaScript, this depends on how a function is called. Arrow functions do not create their own this.

js-this.php
📝 Edit Code
👁 Live Preview
💡 In an event handler, a normal function gets this set to the element.
Chapter 19
∙ Chapter 19

Classes & OOP

Classes organize code into reusable blueprints. They are commonly used for UI components, data models, and app structure.

js-classes.php
📝 Edit Code
👁 Live Preview
💡 Use extends and super() for inheritance. Keep classes small.
Chapter 20
∙ Chapter 20

Array Methods

Instead of manual loops, you can use map, filter, and reduce for clean, readable code.

js-array-methods.php
📝 Edit Code
👁 Live Preview
💡 Rule: map = transform, filter = keep/remove, reduce = combine.
Chapter 21
∙ Chapter 21

JSON & Storage

localStorage stores strings. Convert objects with JSON.stringify and back with JSON.parse.

js-storage.php
📝 Edit Code
👁 Live Preview
💡 This is perfect for small preferences. Avoid storing large data in localStorage.
Chapter 22
∙ Chapter 22

Error Handling

Use try/catch to catch errors and keep the UI working. Log details to the console for debugging.

js-errors.php
📝 Edit Code
👁 Live Preview
💡 Users get a simple message. Developers get details via console.error.
Chapter 23
∙ Chapter 23

Async/Await & Fetch

async/await makes promise-based code easier to read. This demo uses a data: URL so it works without internet.

js-asyncawait.php
📝 Edit Code
👁 Live Preview
💡 Use try/catch with async functions to handle errors cleanly.
Chapter 24
∙ Chapter 24

Timers & Intervals

Use setTimeout for one-time delays and setInterval for repeated tasks. Always clear intervals to avoid leaks.

js-timers.php
📝 Edit Code
👁 Live Preview
💡 The if(t) return line prevents starting multiple intervals.
Chapter 25
∙ Chapter 25

Mini Project: To-Do List

Build a tiny to-do list with DOM + events + storage. Add tasks, delete tasks, and keep them saved in the browser.

js-todo.php
📝 Edit Code
👁 Live Preview
💡 Tasks persist because they are saved in localStorage.
PreviousJavaScript Basics
🎉 Node.js Tutorial Complete (25 topics)!
Next UpMongoDB Basics →