Which keyword is used to declare a variable with block scope in TypeScript?
Which keyword is used to declare a variable with block scope in TypeScript?
let allows reassignment, but const does not
const allows reassignment, but let does not
What will be the output of the following code?
TypeScript
let a = 10 ;
a = "Hello" ;
console . log ( a );
Which data type is NOT available in TypeScript?
What does typeof null return in TypeScript?
What is the any type used for in TypeScript?
To allow variables to hold any type of value
To restrict a variable to a single type
To enforce strict type checking
To define a variable without assigning a value
What is the default type of a variable declared without an explicit type in TypeScript?
What will be the output of the following code?
TypeScript
let x : unknown = "Hello" ;
console . log ( x . length );
Which type allows a variable to store either a number or a string?
What does the readonly modifier do in TypeScript?
Prevents reassignment of a variable
Prevents modification of a property after initialization
Prevents a variable from being accessed
Makes a variable null by default
Ready to go from coding beginner to development pro? Our DSA to Development Coding Guide has everything you need to crush coding interviews and ace real-world projects! Limited spots available!Enroll Now and Transform Your Coding Skills! Also get 90% fee refund on completing 90% of the course in 90 days ! Take the Three 90 Challenge today.
There are 10 questions to complete.
Take a part in the ongoing discussion View All Discussion