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

Typescript

The document discusses various aspects of TypeScript, including decorators, generics, type annotations, and inheritance. It also addresses misconceptions about TypeScript's capabilities and syntax. Additionally, it highlights the differences between TypeScript and JavaScript, as well as the importance of static type checking.

Uploaded by

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

Typescript

The document discusses various aspects of TypeScript, including decorators, generics, type annotations, and inheritance. It also addresses misconceptions about TypeScript's capabilities and syntax. Additionally, it highlights the differences between TypeScript and JavaScript, as well as the importance of static type checking.

Uploaded by

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

var jarvis = function (x: number, y?

: number): number {} showcases both


var jarvis = function (x: number, y?: number): number {} showcases Both
_________ in the command line enables experimental support for deco"tsc --target ES5 --experimentalDecorators"
__________ in command line enables experimental support for decoratexperimentalDecorators: true*
__________ in command line enables experimental support for decoratexperimentalDecorators: true
“any” is type of generic. FALSE
A JavaScript file cannot be renamed to a TypeScript file FALSE
A JavaScript file cannot be renamed to a TypeScript file FALSE
A type system is a set of Rules
Accessing a class of a module from outside is impossible in TypeScript. FALSE
Accessing a class of a module from outside is impossible in TypeScript. FALSE
Annotations can be implemented as length: number
At most, how many decorators can be applied to a declaration? Multiple
Compiled .js of .ts containing class will also have class. TRUE
Compiled .js of .ts containing class will also have class. FALSE
Contextual typing in TypeScript is a form of ___________. Type Inference
Contextual typing in TypeScript is a form of ___________. Type Checking*
Decorators provide a way for Both the options
Decorators provides a way for ________________. Both
Decorators provides a way for ________________. Annotation*
During compilation time, _______checking is done. Static TypeTo avoid assigning value for parameteris
During compilation, TypeScript code gets converted to assembly langua FALSE
During run time, __checking is done Dynamic Type
Dynamic type checking is done at __________. Run time
Enum organises _______________. Set of related values
Enum organises _______________. Set of related values
Enum organizes a SET OF RELATED VALUES
Generics allows to accept arguments of __________. Different types
Generics allows to accept arguments of __________. Different types
Generics allows to accept arguments of__ Different types
Generics are _______ Template
How can we access a class from a module from outside? By using "module"*
How can we access a class of module from outside? By using "implements"*,
Inheritance is implemented by using which keyword? extends
Likewise other elements, Interface of TypeScript is usually converted to TRUE
Static type checking is done at Compilation time
Syntax for a decorator is @symbol
The code snippet " if (value && typeof value == "string") {}; is used fo Overloading
The code snippet " if (value && typeof value == "string") {}; is used fo Overloading
The following are correct ways of defining variables in TypeScript, except _
The optional parameter can be defined by using TRUE
The value of TypeScript is writing Safer code
To a declaration, at most how many decorators can be applied? Only one per declaration*
To a declaration, at most how many decorators can be applied? Only one per declaration
Type Annotations allows us to Record the intended contract of the function or var
Type Annotations allows us to Record the intended contract of the function or var
Type System is a _____________. Set of rules
TypeScript allows us access to private members via ___________. get and set
TypeScript allows us access to private members via ___________. get and set
Typescript compiler tsc converts code to JavaScript
TypeScript is Object Oriented
TypeScript is a open source programming language. FALSE
TypeScript is a__ Super-set of JavaScript
TypeScript uses prototypical inheritance instead of classical inheritance FALSE
TypeScript was made public by Microsoft
value && typeof value == "DataType" is used for Overloading
We can rename a .js file to .ts file generally TRUE
What is the form associated with @expression? Decorators
What is the form associated with @expression? Decorators
What is true about Mixins in TypeScript? All of these
What is true about Mixins in TypeScript? All of these
What type of checking does Java programming language use? Static type checking
Which is not a type that TypeScript supports? integer
Which is not a type that TypeScript supports? integer
Which keyword is used for Inheritance in TypeScript? extends
Which keyword is used for Inheritance in TypeScript? extends
Which keywork is used to access base class properties? super
Which of the following are inherited from base class? all of these
Which of the following demonstrates function overloading, if possible, if (value && typeof value == "number"){}
Which of the following demonstrates function overloading, if possible, if (value && typeof value == "number"){}
Which of the following is a wrong way to declare the variable in TypeScvar 2
Which of the following is the right way of defining enum? all of these
Which of the following is the right way of defining enum? all of these
Which of the following is the wrong way of defining variables in TypeScvar 10231
Which of the following is the wrong way of defining variables in TypeScvar 10231
Which of the two is used appropriately in JavaScript code: function reverse(s: string) : string;
Which one of the following code snippet is safer? function fn(x: () => void) { x(); }
Which type is assigned to variables with null type None of these
Which type is assigned to variables with null type? None of these+
Why optional parameters are added? To avoid assigning value for parameterised variable
Why optional parameters are added? To assure that value is always assigned to the varia
To avoid assigning value for parameteris
By using "module" only
perimentalDecorators"

assigning value for parameterised variable*

contract of the function or variable.


contract of the function or variable.
alue == "number"){}
alue == "number"){}

tring) : string;

alue for parameterised variable


is always assigned to the variable*,
assigning value for parameterised variable+
module" only

You might also like