TS2551

Property 'title' does not exist on type 'Video'. Did you mean 'titles'?

Broken Code ❌

interface Video {
  titles: string;
}
 
function showEpisode(this: Video, tag: string) {
  console.log(`${this.title} - ${tag}`);
}

Fixed Code ✔️

There is a typo in our code which TypeScript's compiler has caught for us. We have to rename the titles property:

interface Video {
  title: string;
}
 
function showEpisode(this: Video, tag: string) {
  console.log(`${this.title} - ${tag}`);
}