Easy
What is the result of compiling the following TypeScript code?
interface Animal {
name: string;
}
interface Dog extends Animal {
breed: string;
}
const myDog: Dog = {
name: 'Buddy',
breed: 'Labrador',
};
function printName(animal: Animal): void {
console.log(animal.name);
}
printName(myDog);
Author: Vincent CotroStatus: PublishedQuestion passed 1202 times
Edit
4
Community EvaluationsNo one has reviewed this question yet, be the first!
8
Write a generic interface in Typescript12
Define a custom type that represents a coordinate with an x and y property of type number in Typescript8
Create a generic identity function that returns the passed value in Typescript7
Import an add function from a TypeScript module math.ts13
Which of the following utility types makes all properties of a given type optional?6
Typescript: What is the inferred type of the result variable?10
Typescript: What is the type of result?