Q1 | What is `TypeScript`? | |
---|
Q2 | What is the type of `animal` in the code example below?
```
const animal: string = "lion";
... | |
---|
Q3 | What will be output to the console after the following code is executed? Will any type errors o... | |
---|
Q4 | What is the problem with the following code?
```
function greet(name: string, age: number):... | |
---|
Q5 | Will the following assignments generate any type errors?
```
let num: number = 5;
let... | |
---|
Q6 | Will the following assignments generate any type errors?
```
let num: number = 5;
le... | |
---|
Q7 | We have a variable that will hold a two-dimensional point (GPS Coordinates: latitude and longit... | |
---|
Q8 | We have a function below that takes in a varying number of message parameters and outputs them ... | |
---|
Q9 | What will TypeScript infer the type of the `people` variable to be in the declaration below?
`... | |
---|
Q10 | What is the correct syntax for creating an array of numbers in TypeScript? | |
---|
Q11 | What is the correct type of annotation for creating an array of dates? | |
---|
Q12 | What is the return type in the function below?
```typescript
function add(a: number, b: num... | |
---|
Q13 | Will TypeScript detect a problem with the following code? If so, what's the problem?
```type... | |
---|
Q14 | Will TypeScript detect a problem with the following code? If so, what's the problem?
```type... | |
---|
Q15 | What is the type of the message parameter in the following function?
```typescript
function... | |
---|
Q16 | Which of the following types is the type of the message parameter in the following function?
... | |
---|
Q17 | What is the type of the parameter in the following function declaration: `function ex(param1?: ... | |
---|
Q18 | What is the return type for when nothing is returned in TypeScript? | |
---|
Q19 | What is `Definitely Typed`? | |
---|
Q20 | In TypeScript, when a numeric enum is defined without assigning a value to its first member, wh... | |
---|
Q21 | What are the two types of enums in TypeScript? | |
---|
Q22 | What is the inherited type for the variable greet in `const greet = ['Hello World!']`? | |
---|
Q23 | What is similar to `any`, but a safer alternative when uncertain about the type? | |
---|
Q24 | Which TypeScript compiler option can be used to disable implicit variable type assignment? | |
---|
Q25 | Which data type in TypeScript is used to represent a collection of elements? | |
---|
Q26 | What type of assignment is this variable, `const age: number = 30;`? | |
---|
Q27 | What are the three main 'simple types' in TypeScript? | |
---|
Q28 | How are type annotations used in TypeScript? | |
---|
Q29 | How does TypeScript relate to JavaScript? | |
---|
Q30 | What is the main benefit of using TypeScript in a project? | |
---|