Quiz: TypeScript. Interfaces and Classes.

Descripción

Information Technology Test sobre Quiz: TypeScript. Interfaces and Classes., creado por Levon Badalian el 28/04/2017.
Levon Badalian
Test por Levon Badalian, actualizado hace más de 1 año
Levon Badalian
Creado por Levon Badalian hace alrededor de 7 años
7
0

Resumen del Recurso

Pregunta 1

Pregunta
Consider 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 "John Doe"? Select all that apply.
Respuesta
  • let fullname = getFullName({ title: "Mr", firstname: "John", surname: "Doe" }); console.info(fullname);
  • let myName = { title: "Mr", firstname: "John", surname: "Doe" } let fullname = getFullName(myName); console.info(fullname);
  • let myName: Person = { firstname:"Johnathan", surname: "Doe" } myName.firstname = "John"; let fullname = getFullName(myName); console.info(fullname);
  • let myName: Person = { middlename:"John", surname: "Doe" } let fullname = getFullName(myName); console.info(fullname);

Pregunta 2

Pregunta
Which of the following keywords can be used in TypeScript to implement interface and inheritance. Choose all that appy.
Respuesta
  • implements
  • inherits
  • super
  • base
  • extends

Pregunta 3

Pregunta
Which of the following is possible to do in TypeScript? Choose all that apply.
Respuesta
  • class implements interface
  • class extends interface
  • interface extends interface
  • interface extends class
  • interface implements class
  • interface implements interface
Mostrar resumen completo Ocultar resumen completo

Similar

CCNA Security 210-260 IINS - Exam 3
Mike M
Application of technology in learning
Jeff Wall
Innovative Uses of Technology
John Marttila
Ch1 - The nature of IT Projects
mauricio5509
The Internet
Gee_0599
SQL Quiz
R M
CCNA Answers – CCNA Exam
Abdul Demir
Professional, Legal, and Ethical Issues in Information Security
mfundo.falteni
System Analysis
R A
Flash Cards Networks
JJ Pro Wrestler
EDUC260- Multimodal Literacies for a Digital Age
angelwoo2002