Skip to main content Link Menu Expand (external link) Document Search Copy Copied

| Code | Result | | - | - |

class Cat {
  private name: string; 
  private color: string; 
  constructor(name, color) { this.name = name;  this.color = color;}
}

same as

class Cat {
    constructor(private name, private color) {}
    }

usage

let fluffy = new Cat('fluffy', 'White')