0% found this document useful (0 votes)
348 views

Type Script

TypeScript converts code to JavaScript, is object oriented, and is a superset of JavaScript. Static type checking is done at compilation time. Generics allow accepting arguments of different types. Type annotations allow recording the intended contract of a function or variable.

Uploaded by

Manoj Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
348 views

Type Script

TypeScript converts code to JavaScript, is object oriented, and is a superset of JavaScript. Static type checking is done at compilation time. Generics allow accepting arguments of different types. Type annotations allow recording the intended contract of a function or variable.

Uploaded by

Manoj Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

TypeScript

--------------------
Typescript compiler tsc converts code to - JavaScript
TypeScript is - Object Oriented
TypeScript is a - Super-set of JavaScript
We can rename a .js file to .ts file generally - true
The value of TypeScript is writing - Safer code
TypeScript was made public by - Microsoft
A JavaScript file cannot be renamed to a TypeScript file - false
--------------------
During run time, __checking is done - Dynamic Type
Which type is assigned to variables with null type - None of these
Annotations can be implemented as - length: number
Generics allows to accept arguments of - Different types
Type Annotations allows us to - Record the intended contract of the function or
variable.
A type system is a set of - Rules
Static type checking is done at - Compilation time
-----------------------
Generics are _ - Template
Which of the following is the right way of defining enum? - all
-----------------------
Syntax for a decorator is - @symbol
Which of the two is used appropriately in JavaScript code: - function reverse(s:
string) : string;
" var jarvis = function (x: number, y?: number): number {} " showcases - both
Inheritance is implemented by using which keyword? - extends
Which of the following is the wrong way of defining variables in TypeScript - var
10231
-----------------------
Which keyword is used for Inheritance in TypeScript? - extends
Which of the following are inherited from base class? - all
Which keywork is used to access base class properties? - super
The code snippet " if (value && typeof value == "string") {}; is used for _ -
Overloading
TypeScript uses prototypical inheritance instead of classical inheritance. - false
----------------------
Compiled .js of .ts containing class will also have class. - false
Accessing a class of a module from outside is impossible in TypeScript. - false
Likewise other elements, Interface of TypeScript is usually converted to
JavaScript. - false
Contextual typing in TypeScript is a form of - not Type Checking************
Decorators provides a way for - both
Which of the following is a wrong way to declare the variable in TypeScript? - var
2
What is the form associated with @expression? - Decorators
Optional parameter can be defined by using "?". - true
Which one of the following code snippet is safer? - function fn(x: () => void)
{ x(); }
How can we access a class of module from outside? - By using "export"
Enum organises - Set of related values
During compilation, TypeScript code gets converted to assembly language.- false
_ in command line enables experimental support for decorators. - " tsc –target ES5
–experimentalDecorators "
Type System is a - Set of rules
Which is not a type that TypeScript supports - integer
What is true about Mixins in TypeScript? - all
Why optional parameters are added? - not To avoid assigning value for parameterised
variable************
“any” is type of generic. FALSE
"any" type is assigned to the variable in case of - not initialising variable
(wrong answer)
Which is not a type that TypeScript supports? enum (wrong anser)
During compilation time, _______checking is done. static
TypeScript is a open source programming language. TRUE
To a declaration, at most how many decorators can be applied? Multiple (wrong
anser)
Which of the following demonstrates function overloading, if possible, in
TypeScript? var a=function(n1:number,n3?:number):number{})
What type of checking does Java programming language use? static

You might also like