GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Quiz

Quiz: TypeScript. Interfaces and Classes.

Gelöschter Nutzer 3 Fragen Aktualisiert am 30 Apr 2017

Quiz starten

Fragen in diesem 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

Informationen

Beschreibung
Der Nutzer hat seine Fachbereichs-Information gelöscht. Quiz am Quiz: TypeScript. Interfaces and Classes., erstellt von Gelöschter Nutzer am 30/04/2017.
Autor
Gelöschter Nutzer
Sprache
English
Aufrufe
26
Verlauf
Erstellt am 30 Apr 2017 · aktualisiert am 30 Apr 2017

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck