---
title: "TypeScript: Typed JavaScript Fundamentals"
lang: "en"
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/post/typescript-fundamentals-quiz
---

[Home](/)›[Quizzes](/quizzes)›[All Categories](/quizzes/categories)›[TypeScript](/quizzes/categories/typescript)

Quizzes

[TypeScript](/quizzes/categories/typescript)[Programming](/quizzes/categories/programming)[Web Development](/quizzes/categories/web-development)[Frontend](/quizzes/categories/frontend)

# TypeScript: Typed JavaScript Fundamentals

[Mohammad Abu Mattar](/authors/mohammad-abu-mattar)20 QuestionsIntermediatePublished: 04 Feb 2026

[Markdown for AI(opens in a new tab)](/post/typescript-fundamentals-quiz/index.md "Open the plain-Markdown version of this page, for pasting into an AI tool")

Series

[Frontend Essentials](/series/frontend-essentials)2/4

[PreviousJavaScript: Language Fundamentals & Modern Features](/quizzes/post/javascript-fundamentals-quiz)[NextCSS Fundamentals: Selectors, Box Model & Styling](/quizzes/post/css-fundamentals-quiz)

All posts in this series (4)

Quizzes4

1.  [JavaScript: Language Fundamentals & Modern Features](/quizzes/post/javascript-fundamentals-quiz)
2.  [TypeScript: Typed JavaScript FundamentalsYou are here](/quizzes/post/typescript-fundamentals-quiz)
3.  [CSS Fundamentals: Selectors, Box Model & Styling](/quizzes/post/css-fundamentals-quiz)
4.  [HTML Semantics & Web Accessibility](/quizzes/post/html-semantics-accessibility-quiz)

## TypeScript: Typed JavaScript Fundamentals

Up to 20 questions, shuffled on every run

Quiz Configuration

Enterto start

Welcome to the TypeScript Basics Quiz! This quiz covers fundamental TypeScript concepts, static typing, and type-safe programming best practices. Each question is multiple-choice, and you’ll find hints to help you along the way. Good luck!

Answer key and explanations20 questions

The quiz above draws 20 questions at random from these 30, so a second attempt will not be the same run. Everything in the pool is listed here.

1.  What is the primary purpose of TypeScript?
    
    AnswerTo provide static type checking for JavaScript code
    
2.  Which command is used to compile a TypeScript file into JavaScript?
    
    Answer\`tsc\`
    
3.  How do you define an interface for a User object?
    
    Answer\`interface User { name: string; }\`
    
4.  What does the "any" type do?
    
    AnswerIt disables type checking for a particular variable
    
5.  What is a "Tuple" in TypeScript?
    
    AnswerAn array with a fixed number of elements and known types
    
6.  Which keyword is used to make an interface property optional?
    
    Answer\`?\`
    
7.  What is an "Enum"?
    
    AnswerA collection of related and named constant numeric values
    
8.  What does the "void" type signify when used on a function?
    
    AnswerThe function performs an action but returns no value
    
9.  How do you define a Union Type in TypeScript?
    
    Answer\`string | number\`
    
10.  What is the "unknown" type?
     
     AnswerA safer type that requires a type check before any usage
     
11.  What is the purpose of the "readonly" keyword?
     
     AnswerTo prevent a property from being changed after assignment
     
12.  What is "Generics" in TypeScript?
     
     AnswerA way to create components that work with a variety of types
     
13.  Which file contains the configuration for a TypeScript project?
     
     Answer\`tsconfig.json\`
     
14.  What is "Type Inference"?
     
     AnswerWhen the compiler automatically detects a variable type
     
15.  What is the "never" type used for?
     
     AnswerFor functions that do not reach an end point or return
     
16.  How do you extend an interface?
     
     Answer\`interface Admin extends User\`
     
17.  What is an "Abstract Class"?
     
     AnswerA base class that cannot be instantiated directly
     
18.  Which keyword is used to access the parent class constructor?
     
     Answer\`super()\`
     
19.  What is a "Type Guard"?
     
     AnswerA check that narrows a type within a specific scope
     
20.  What is the "as" keyword used for?
     
     Answer\`To tell the compiler to treat a value as a specific type\`
     
21.  What is the result of transpiling TypeScript to JavaScript?
     
     AnswerA standard JavaScript file with all types removed
     
22.  How do you declare a private property in a TypeScript class?
     
     Answer\`private name: string;\`
     
23.  What is "Literal Types"?
     
     AnswerA type that can only hold a specific, exact value
     
24.  What is "Intersection Type"?
     
     AnswerA type that combines multiple types into a single one
     
25.  What is the "protected" modifier?
     
     AnswerIt makes properties visible to a class and its children
     
26.  How do you define a function type in an interface?
     
     Answer\`myFunc(): void;\`
     
27.  What is "Namespace" in TypeScript?
     
     AnswerA way to group related code and prevent collisions
     
28.  What is the "keyof" operator?
     
     AnswerIt creates a union type of all keys from an object type
     
29.  What does "Strict Mode" in tsconfig do?
     
     AnswerIt enables comprehensive checks for more reliable code
     
30.  What is the "!" operator (Non-null assertion)?
     
     AnswerIt asserts that a value is not null or undefined
     

## Tags

[#TypeScript](/quizzes/tags/typescript)[#Static Typing](/quizzes/tags/static-typing)[#Interfaces](/quizzes/tags/interfaces)[#Generics](/quizzes/tags/generics)[#Type Guards](/quizzes/tags/type-guards)[#TypeScript Compiler](/quizzes/tags/typescript-compiler)[#Web Development](/quizzes/tags/web-development)[#Frontend Development](/quizzes/tags/frontend-development)[#Programming](/quizzes/tags/programming)

## Share

[Facebook](https://facebook.com/sharer/sharer.php?u=https%3A%2F%2Fmkabumattar.com%2Fquizzes%2Fpost%2Ftypescript-fundamentals-quiz "Share on Facebook")[Twitter](https://twitter.com/intent/tweet/?text=TypeScript%3A%20Typed%20JavaScript%20Fundamentals&url=https%3A%2F%2Fmkabumattar.com%2Fquizzes%2Fpost%2Ftypescript-fundamentals-quiz "Share on Twitter")[LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fmkabumattar.com%2Fquizzes%2Fpost%2Ftypescript-fundamentals-quiz&title=TypeScript%3A%20Typed%20JavaScript%20Fundamentals&summary=Test%20your%20knowledge%20of%20TypeScript%20fundamentals%20with%20a%20quiz%20covering%20static%20typing%2C%20interfaces%2C%20generics%2C%20type%20guards%2C%20enums%2C%20classes%2C%20advanced%20types%2C%20and%20TypeScript%20best%20practices.&source=https://mkabumattar.com "Share on LinkedIn")[WhatsApp](https://wa.me/?text=TypeScript%3A%20Typed%20JavaScript%20Fundamentals%20https%3A%2F%2Fmkabumattar.com%2Fquizzes%2Fpost%2Ftypescript-fundamentals-quiz "Share on WhatsApp")[Telegram](https://t.me/share/url?url=https%3A%2F%2Fmkabumattar.com%2Fquizzes%2Fpost%2Ftypescript-fundamentals-quiz&text=TypeScript%3A%20Typed%20JavaScript%20Fundamentals "Share on Telegram")[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fmkabumattar.com%2Fquizzes%2Fpost%2Ftypescript-fundamentals-quiz&title=TypeScript%3A%20Typed%20JavaScript%20Fundamentals "Share on Reddit")[Hacker News](http://news.ycombinator.com/submitlink?u=https%3A%2F%2Fmkabumattar.com%2Fquizzes%2Fpost%2Ftypescript-fundamentals-quiz&t=TypeScript%3A%20Typed%20JavaScript%20Fundamentals "Share on Hacker News")[Pinterest](https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fmkabumattar.com%2Fquizzes%2Fpost%2Ftypescript-fundamentals-quiz&media=&description=Test%20your%20knowledge%20of%20TypeScript%20fundamentals%20with%20a%20quiz%20covering%20static%20typing%2C%20interfaces%2C%20generics%2C%20type%20guards%2C%20enums%2C%20classes%2C%20advanced%20types%2C%20and%20TypeScript%20best%20practices. "Share on Pinterest")[Email](<mailto:?subject=TypeScript%3A%20Typed%20JavaScript%20Fundamentals&body=Check out this article: https%3A%2F%2Fmkabumattar.com%2Fquizzes%2Fpost%2Ftypescript-fundamentals-quiz>)

## Comments

Was this useful?

## You might also enjoy

More posts on similar topics

[![JavaScript: Language Fundamentals & Modern Features](/_astro/hero.CPnUQqYa_cqDLj.webp)](/quizzes/post/javascript-fundamentals-quiz)

## [JavaScript: Language Fundamentals & Modern Features](/quizzes/post/javascript-fundamentals-quiz)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [JavaScript](/quizzes/categories/javascript)
-   [Programming](/quizzes/categories/programming)
-   [Web Development](/quizzes/categories/web-development)
-   [Frontend](/quizzes/categories/frontend)

Welcome to the JavaScript Basics Quiz! This quiz tests your understanding of fundamental JavaScript concepts, syntax, and modern programming best practices. Each question is multiple-choice, and you'l

[#JavaScript](/quizzes/tags/javascript)[#ES6](/quizzes/tags/es6)[#Arrow Functions](/quizzes/tags/arrow-functions)+6 tags

[read more](/quizzes/post/javascript-fundamentals-quiz)

[![CSS Fundamentals: Selectors, Box Model & Styling](/_astro/hero.BuNubOK1_Z1Tx9uc.webp)](/quizzes/post/css-fundamentals-quiz)

## [CSS Fundamentals: Selectors, Box Model & Styling](/quizzes/post/css-fundamentals-quiz)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [CSS](/quizzes/categories/css)
-   [Frontend](/quizzes/categories/frontend)
-   [Quizzes](/quizzes/categories/quizzes)

Welcome to the CSS Fundamentals quiz! This quiz will test your knowledge of CSS basics, including selectors, the box model, properties, and layout techniques. Each question reinforces one concept so y

[#Css](/quizzes/tags/css)[#Css fundamentals](/quizzes/tags/css-fundamentals)[#Selectors](/quizzes/tags/selectors)+11 tags

[read more](/quizzes/post/css-fundamentals-quiz)

[![HTML Semantics & Web Accessibility](/_astro/hero.DeLGVsAp_ZP225h.webp)](/quizzes/post/html-semantics-accessibility-quiz)

## [HTML Semantics & Web Accessibility](/quizzes/post/html-semantics-accessibility-quiz)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [HTML](/quizzes/categories/html)
-   [Accessibility](/quizzes/categories/accessibility)
-   [Quizzes](/quizzes/categories/quizzes)

Welcome to the HTML Semantics & Accessibility Quiz! This quiz will test your knowledge of semantic HTML elements and web accessibility best practices. Each question has a hint to help you out, and you

[#Html](/quizzes/tags/html)[#Html semantics](/quizzes/tags/html-semantics)[#Accessibility](/quizzes/tags/accessibility)+11 tags

[read more](/quizzes/post/html-semantics-accessibility-quiz)

[![TypeScript Advanced: Types, Generics, Utility Types](/_astro/hero.DBh42TOh_hyqHY.webp)](/quizzes/post/typescript-advanced-quiz)

## [TypeScript Advanced: Types, Generics, Utility Types](/quizzes/post/typescript-advanced-quiz)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [Programming](/quizzes/categories/programming)
-   [Frontend](/quizzes/categories/frontend)

Welcome to the TypeScript Advanced Quiz! Test your knowledge on advanced types, generics, utility types, and more. Each question has a hint and explanations for all options. Good luck!

[#TypeScript](/quizzes/tags/typescript)[#Types](/quizzes/tags/types)[#Advanced](/quizzes/tags/advanced)

[read more](/quizzes/post/typescript-advanced-quiz)

[![Python: Programming Fundamentals & Best Practices](/_astro/hero.C1sFrIvr_20a5yU.webp)](/quizzes/post/python-programming-fundamentals-quiz)

## [Python: Programming Fundamentals & Best Practices](/quizzes/post/python-programming-fundamentals-quiz)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [Python](/quizzes/categories/python)
-   [Programming](/quizzes/categories/programming)
-   [Software Development](/quizzes/categories/software-development)
-   [Data Science](/quizzes/categories/data-science)

Welcome to the Python Basics Quiz! This quiz tests your understanding of fundamental Python concepts, syntax, and programming best practices. Each question is multiple-choice, and you'll find hints to

[#Python](/quizzes/tags/python)[#Python Programming](/quizzes/tags/python-programming)[#Python Basics](/quizzes/tags/python-basics)+6 tags

[read more](/quizzes/post/python-programming-fundamentals-quiz)

[![Java: Core Language & JVM Fundamentals](/_astro/hero.MRO-sQtF_2x4c20.webp)](/quizzes/post/java-fundamentals-quiz)

## [Java: Core Language & JVM Fundamentals](/quizzes/post/java-fundamentals-quiz)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [Java](/quizzes/categories/java)
-   [JVM](/quizzes/categories/jvm)
-   [Programming](/quizzes/categories/programming)

Java has quietly powered banks, Android, and countless backend systems for decades, and the language keeps evolving with records, sealed classes, and virtual threads. This quiz walks through the core

[#Java](/quizzes/tags/java)[#JVM](/quizzes/tags/jvm)[#OOP](/quizzes/tags/oop)+3 tags

[read more](/quizzes/post/java-fundamentals-quiz)

6 related posts
