Search Header Logo

Quiz 1

Authored by Abhishek Chaudhari

Computers

University

Quiz 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

26 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the difference between interface and abstract class in TypeScript inheritance?

Interfaces define structure, abstract classes define behavior and partial structure.

Both define structure, but interfaces cannot have implementations.

Both define behavior, but interfaces cannot be instantiated.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which component in TypeScript compiles .ts files into .js files?

TypeScript Parser

TypeScript Compiler

JavaScript Engine

TypeScript Module

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to declare a block-scoped variable in TypeScript?

var

let

const

Both b and c

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you import a module in TypeScript?

import { myModule } from './myModule';

require('./myModule');

load('./myModule');

fetch('./myModule');

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is not allowed in TypeScript because of strict type checking?

==

===

!==

All are allowed

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary advantage of TypeScript over JavaScript?

Faster execution time

Enhanced type safety during development

More concise syntax

Built-in support for browser execution

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for defining a named function in TypeScript?

function myFunction() {}

let myFunction = () => {}

const myFunction = function() {}

All of the above

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?