Typescript Interview Questions

0
(0)

Typescript Interview Questions – Typescript

 

Q 1: What is Typescript?
TypeScript is a free and open-source programming language developed and maintained by Microsoft.
It is a strongly typed superset of JavaScript that compiles to plain JavaScript.
TypeScript can be executed on Any browser, Any Host, and Any Operating System.
TypeScript is not directly run on the browser. It needs a compiler to compile and generate in JavaScript file.
TypeScript is the ES6 version of JavaScript with some additional features.
Angular built entirely in TypeScript and used as a primary language.
You can install it globally as npm install -g typescript
Q 2: List the built-in types in Typescript.
Typescript only supports primitive data types
Number
— represent number type values. All the numbers in TypeScript are stored as floating point values.
    number = value;
String
— represents a sequence of characters stored as Unicode UTF-16 code. We include string literals in our scripts by enclosing them in single or double quotation marks.
    let identifier: string = ” “;
Boolean
— represent a logical value, that outputs  a condition either true or false.
    let identifier: bool = Boolean value;
Null:
—  represents a variable whose value is undefined. It is not possible to directly reference the null type value itself.
     let num: number = null;
Undefined
— represents a type of undefined literal. The Undefined type denotes all uninitialized variables.
    let num: number = undefined;
Void
— A void is the return type of the functions that do not return any type of value. It is used where no datatype is available.
    let unusable: void = undefined;

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

Be the first to comment

Leave a Reply

Your email address will not be published.


*


nineteen + four =