JSFiddle - React, Tailwind, and code Playground

by David Kyle

TypeScript

'use strict';
class SomeClass {
	public Test: string;
}

class OtherThing {
	public hasItem: boolean;
  
  constructor() {
  	this.hasItem = false;
  }
}

function CheckThing(thing: any): boolean {
	return thing.hasItem;
}

console.log(CheckThing(new OtherThing()));
console.log(CheckThing(new SomeClass()));