Problem Statement
Which are primitive types in TypeScript?
Explanation
string, number, boolean, bigint, and symbol are primitive types—immutable values stored by value. null and undefined are also primitives but are often discussed separately as special values. Objects, arrays, and functions are reference types, while enums and tuples are TypeScript constructs built on top of JavaScript.
Code Solution
SolutionRead Only
const s: string = 'hi';
const n: number = 42;
const b: boolean = true;
const big: bigint = 9007199254740993n;
const sym: symbol = Symbol('id');