Skip to content
GateShala
PythonCJavaJavaScriptDSAGATE CS Playground
Playground
JavaScript Tutorial

1Getting Started

  • Your First JavaScript Program
  • Variables and Data Types
  • Operators

2Control Flow

  • Conditions with if
  • Loops

3Functions

  • Functions
  • Scope and Closures

4Working with Data

  • Strings
  • Arrays
  • Objects
  • Destructuring and Spread
  • Map and Set

5Advanced JavaScript

  • Classes
  • Error Handling
  • Promises and async/await
Home/JavaScript

JavaScript Tutorial

JavaScript runs in every web browser, so every example on these pages can be run right here with the Run button. No installation needed.

Start the first lesson

1Getting Started

  1. Your First JavaScript ProgramWhat JavaScript is, where it runs, and how to print with console.log.
  2. Variables and Data Typeslet, const, and JavaScript's main value types.
  3. OperatorsArithmetic, assignment, comparison and logical operators, plus a few JavaScript surprises.

2Control Flow

  1. Conditions with ifMake decisions with if, else, comparison operators and the ternary operator.
  2. LoopsRepeat code with for, for...of, while and array methods.

3Functions

  1. FunctionsDeclare functions, use arrow functions, default parameters and callbacks.
  2. Scope and ClosuresUnderstand where variables are visible and how functions remember their surroundings.

4Working with Data

  1. StringsSearch, slice, split and transform text.
  2. ArraysAdd, remove, search and sort items in arrays.
  3. ObjectsGroup related data with key-value pairs and add methods to objects.
  4. Destructuring and SpreadUnpack values, merge objects and handle missing data with modern syntax.
  5. Map and SetUse Map for key-value data and Set for unique values.

5Advanced JavaScript

  1. ClassesCreate objects from blueprints with class, constructor, methods and inheritance.
  2. Error HandlingCatch and throw errors with try, catch and finally.
  3. Promises and async/awaitWork with tasks that finish later, such as timers and network requests.
GateShala

Learn to code, one small lesson at a time. All lessons are free to read.

PythonCJavaJavaScriptDSAGATE CSPlayground