/** Greets one person, several times over. */ export class Greeter { #name; constructor(name) { this.#name = name; } /** Prints the greeting `times` times and says whether the name is capitalised. */ greet(times = 1) { const pattern = /^[A-Z]/; for (let i = 1; i <= times; i++) { console.log(`Hello, ${this.#name}! (${i})`); } return pattern.test(this.#name); } }