JavaScript Comprehensive Study Guide

JavaScript Fundamentals

Variables and Data Types

JavaScript has three ways to declare variables:

var oldWay = "I'm using var"; // Function scoped, can be redeclared
let modern = "I'm using let"; // Block scoped, can be reassigned
const constant = "I won't change"; // Block scoped, cannot be reassigned

Primitive Data Types:

Reference Types:

Operators

Arithmetic Operators

const sum = 5 + 3;      // 8
const difference = 5 - 3; // 2
const product = 5 * 3;   // 15
const quotient = 5 / 3;  // 1.6666...
const remainder = 5 % 3; // 2
const exponent = 5 ** 3; // 125 (5³)