Skip to main content

JS vs TS classes

FeatureJavaScriptTypeScript
ClassesYesYes
Typing of properties/methodsNoYes
Access modifiersNoYes
readonly fieldsNoYes
Abstract classesNoYes
Interfaces and implementsNoYes
GenericsNoYes
Decorators(new standard)Yes (earlier)
Compile-time type checkingNoYes
constructor(public field) syntaxNoYes

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.