bobbyache

TypeScript - Basic Inheritance

Sep 27th, 2019
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. class Engine {
  2.  
  3. }
  4.  
  5. class Auto {
  6. engine: Engine;
  7.  
  8. constructor(engine: Engine) {
  9. this.engine = engine;
  10. }
  11. }
  12.  
  13. class Truck extends Auto {
  14. fourByFour: boolean;
  15.  
  16. constructor(engine: Engine, fourByFour: boolean) {
  17. super(engine);
  18. this.fourByFour = fourByFour;
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment