Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save tuanlc/aa4842d8baade66a86c1279f50806ac1 to your computer and use it in GitHub Desktop.

Select an option

Save tuanlc/aa4842d8baade66a86c1279f50806ac1 to your computer and use it in GitHub Desktop.
export default class Student {
  name: string;
  email: string;
  #phone: string;
  
  constructor(name: string, email: string, phone: string) {
    this.name = name;
    this.email = email;
    this.#phone = phone;
  }

  get4FirstNumbersOfPhone() {
    return this.#phone.substring(0, 4);
  }

  #playGame() {
    // Private time to play game (^-^)
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment