JavaScript Concepts

Dynamic Typing in JavaScript

JavaScript is a dynamically typed language, meaning variables can hold different types of values without explicit type declaration. The type checking is done at runtime.

let x = 42;        // number
x = "Hello";       // can change to string
x = true;         // can change to boolean

TypeScript

TypeScript is a superset of JavaScript that adds static typing. We need TypeScript for:

String Interpolation

String interpolation allows embedding expressions in strings using template literals (backticks).

const name = "John";
console.log(`Hello ${name}!`);

Functional Programming

Functional programming is a programming paradigm where functions are treated as first-class citizens. It emphasizes:

Function Reference