Levon Badalian
Quiz by , created more than 1 year ago

Information Technology Quiz on Quiz: TypeScript. Basic Types and Variable Declarations., created by Levon Badalian on 25/04/2017.

7
0
0
Levon Badalian
Created by Levon Badalian about 7 years ago
Close

Quiz: TypeScript. Basic Types and Variable Declarations.

Question 1 of 5

1

Please select correct basic types that are available in TypeScript:

Select one of the following:

  • number, null, binary, string, boolean

  • string, boolean, enum, null, never

  • boolean, char, string, number

  • boolean, number, int, enum, void

Explanation

Question 2 of 5

1

Please select correct TypeScript variable declarations. Choose all that apply.

Select one or more of the following:

  • x = "My String";

  • let z = "My String";

  • let a: string = "My String";

  • let myAge: int = 25;

  • let c as string = "My String";

  • let b = ("My String" as string);

Explanation

Question 3 of 5

1

let variable declaration is accessible anywhere within their containing function, module, namespace, or global scope.

Select one of the following:

  • True
  • False

Explanation

Question 4 of 5

1

Please use drag and drop to make sure that variable sentence contains the following string: "Hello, my name is Joe Bloggs. I'm 44 years old."

let myName = "Joe Bloggs";
let myAge: number = 44;

let sentence: string = `Hello, my name is . I'm years old.`;

Drag and drop to complete the text.

    {myName}
    {$myName}
    ${myName}
    $myName
    $myAge.toString()
    ${myAge}
    {$myAge.toString()}
    {$myAge}

Explanation

Question 5 of 5

1

The following code will output in the console:

enum make { Audi = 100, BMW = 200, Citroen=300, Ford, Holden, Hyundai, Jaguar, Kia, Lada }

let myCarMake: make = make.Ford;

console.info(myCarMake.toString());

Select one of the following:

  • Ford

  • 400

  • 301

  • syntax error

Explanation