O GoConqr está de visual novo! Conte para nós o que você achou.

Quiz

Quiz: TypeScript. Interfaces and Classes.

Usuário eliminado 3 perguntas

Fazer o quiz

Perguntas do quiz (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

Informações

Descrição
O usuário eliminou as informações de disciplina Quiz sobre Quiz: TypeScript. Interfaces and Classes., criado por Usuário eliminado em 30-04-2017.
Autor
Usuário eliminado
Idioma
English
Visualizações
26

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?