Question #121

Author: admin
tags: TypeScript  
interface Pet {
  name: string;
  year: number;
  type?: 'dog'|'cat'|'fish'|'parrot';
}

const pet1 = {
  name: 'Blacky',
  year: 2022,
  type: 'cat',
};

const pet2 = {
  name: 'Nibbler',
  year: 2018,
  type: 'crocodile',
};

const pet3 = {
  name: 'Dusty',
  year: 2021,
};

const pet4 = {
  name: 'Pirate',
  year: Number('2021'),
  type: 'fish',
};

const pet5 = {
  name: 'Gizmo',
  year: 2020,
  type: 'dog',
  breed: 'pug',
};
Select objects that are NOT compatible with the interface Pet.
pet1
pet2
pet3
pet4
pet5
Rate the difficulty of the question:
easyhard