Chapter 1: JavaScript Fundamentals
1.1 Introduction to JavaScript
JavaScript (JS) is a versatile, high-level, interpreted programming language primarily used
for creating interactive and dynamic web content. It can be run in the browser for front-end
development and on the server with [Link].
1.2 Values, Variables, and Data Types
Values are pieces of data stored in variables. Variables are declared using let, const, or var.
Data types include Number, String, Boolean, Object, Array, Null, Undefined, Symbol, and
BigInt.
1.3 Naming Conventions
Common naming conventions in JavaScript include camelCase, PascalCase, and snake_case.
camelCase is most common for variables and functions, PascalCase for classes, and
snake_case is less common.
1.4 let vs const vs var
var: Function-scoped, hoisted, can be redeclared.
let: Block-scoped, can be reassigned.
const: Block-scoped, cannot be reassigned.
1.5 Arithmetic Operators
JavaScript arithmetic operators include +, -, *, /, %, and **. Operator precedence determines
execution order in complex expressions.
1.6 Strings and Template Literals
Strings can be defined using single quotes, double quotes, or backticks for template literals.
Template literals allow embedding expressions with ${}.
1.7 Type Conversion and Type Coercion
Type conversion is explicit using functions like Number() and String(). Type coercion
happens automatically when JavaScript converts types during operations.
1.8 Equality Operators
== checks for value equality with type coercion, while === checks for strict equality without
type coercion.
1.9 Logical Operators
Logical AND (&&), OR (||), and NOT (!) are used for conditional logic.
1.10 Truthy and Falsy Values
Falsy values include false, 0, '', null, undefined, and NaN. All other values are truthy.
1.11 If...Else Statements
If...Else statements execute different blocks of code based on conditions.
1.12 Ternary Operator
The ternary operator (condition ? expr1 : expr2) provides a shorthand for if...else
statements.
Chapter 2: Intermediate JavaScript
Includes Switch...Case statements, Arrays and methods, Objects and methods, Functions,
Loops, Strict Mode, ES5 vs ES6, Short Circuiting, Nullish Operator, Closures, Callbacks,
Promises, Async/Await, and Error Handling.