¡GoConqr estrena diseño! Cuéntanos qué te parece.

Test

Quiz: TypeScript. Interfaces and Classes.

Usuario eliminado 3 preguntas

Hacer el test

Preguntas del test (3)

  1. 1Consider the following interface and function:

    interface Person {
    readonly firstname: string;
    middlename?: string;
    surname: string;
    }

    function getFullName(p: Person): string {
    if (p.middlename !== null && p.middlename !== undefined)
    {
    if (p.firstname !== null && p.firstname !== undefined)
    {
    return `${p.firstname} ${p.middlename} ${p.surname}`;
    }
    else
    {
    return `${p.middlename} ${p.surname}`;
    }
    }
    else
    {
    return `${p.firstname} ${p.surname}`;
    }
    }

    Which of the following code snippets will output "Joe Doe"? Select all that apply.
    1. Alet fullname = getFullName({ title: "Mr", firstname: "John", surname: "Doe" });
      console.info(fullname);
    2. Blet myName = { title: "Mr", firstname: "John", surname: "Doe" }
      let fullname = getFullName(myName);
      console.info(fullname);
    3. Clet myName: Person = { firstname:"Johnathan", surname: "Doe" }
      myName.firstname = "John";
      let fullname = getFullName(myName);
      console.info(fullname);
    4. Dlet myName: Person = { middlename:"John", surname: "Doe" }
      let fullname = getFullName(myName);
      console.info(fullname);
  2. 2Which of the following keywords can be used in TypeScript to implement interface and inheritance. Choose all that appy.
    1. Aimplements
    2. Binherits
    3. Csuper
    4. Dbase
    5. Eextends
  3. 3Which of the following is possible to do in TypeScript? Choose all that apply.
    1. Aclass implements interface
    2. Bclass extends interface
    3. Cinterface extends interface
    4. Dinterface extends class
    5. Einterface implements class
    6. Finterface implements interface

Información

Descripción
El usuario ha eliminado su información de asignaturas Test sobre Quiz: TypeScript. Interfaces and Classes., creado por Usuario eliminado el 30/04/2017.
Autor
Usuario eliminado
Idioma
English
Visitas
26

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?