You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classVehical{drive(): void=>{console.log('driving');}beep(): void=>{console.log('beeping');}}classCarextendsVehical{drive(): void{console.log('boom! there you go')}}constcar=newCar();car.beep();car.drive();
typestringOrNumber=string|number;typehasName={name: stirng};// in this, hasName could also contains other values. it won't give you error if you added one for variable in it.typeNumVal=1|2|3|NumArr;interfaceNumArrextendsArray<NumVal>{}constx: NumVal=[1,2,3,4,5,6,7,8,[1,2,3,4,5]];
Generic Types
See generic type examples in generic.ts file into repo.