turbo-editors/turbo-jspublic Fork 0
v1.0.2
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-js.git
git clone ssh://git@rickub.com/turbo-editors/turbo-js.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

greeter.js · 17 lines · 404 BJavaScript Blame HistoryRaw
📦 Turbo JS 91999d1 k33g 13h ago1/** Greets one person, several times over. */
2export class Greeter {
3 #name;
4
5 constructor(name) {
6 this.#name = name;
7 }
8
9 /** Prints the greeting `times` times and says whether the name is capitalised. */
10 greet(times = 1) {
11 const pattern = /^[A-Z]/;
12 for (let i = 1; i <= times; i++) {
13 console.log(`Hello, ${this.#name}! (${i})`);
14 }
15 return pattern.test(this.#name);
16 }
17}