Question #194

Author: admin
tags: TypeScript  
Interface declaration:
interface Planet {
  name: string;
}

interface Planet {
  satellitesAmount: number;
}
Select the correct way to create a variable with this interface.
const p: Planet = {
  name: 'Mars',
};
const p: Planet = {
  satellitesAmount: 2,
};
const p: Planet = {
  name: 'Mars',
  satellitesAmount: 2,
};
None of the options. The declaration of interface is not correct.
This is a TypeScript interface declaration merging.
Rate the difficulty of the question:
easyhard