Skip to main content
InterviewHubPRO
Section Overview
Q2

Question 2 of 50

Part 1: Basic & Foundational TypeScript (Junior / Entry-Level)

4%
TypeScript Master (50 Qs)•Part 1: Basic & Foundational TypeScript (Junior / Entry-Level)

What are Primitive Types vs Object Types in TypeScript?

junior LevelTypeScript

In Simple Words:

  • Primitive Types: Built-in immutable JavaScript primitives: string, number, boolean, bigint, symbol, null, undefined.
  • Object Types: Non-primitive structures: object, arrays (number[]), interfaces, classes, tuples, and functions.
  • Convention Note: Always use lowercase primitive types (string, number, boolean). Capitalized types (String, Number, Boolean) refer to JavaScript's boxed object wrapper prototypes and should never be used as types.