Type guards and Differentiating Types

class AbstractView {
  constructor() {}
}

type Page = {
  path: string;
  view: AbstractView;
};

const page: Page = {
    path: '',
    view: new AbstractView
}

// (1) 'in' operator check
console.log('path' in page);