TypeScript: Difference between Interface and Type Aliases
1 min read

TypeScript: Difference between Interface and Type Aliases

New fields could be added to an already defined interface.

interface Place {
    title: string
}

interface Place {
    subtitle: string
}

var p: Place = {title: "title", subtitle: "subtitle"}

A type cannot be changed after it is declared.

type Place = {
    title: string
}

type Place = { 
    subitle: string
} // ERROR: Duplicate identifier 'Place'