You Know Me?
Something went wrong. Try again.
profile.ts
· Created 1mo ago ·801 B · 32 lines
TypeScript
1234567891011121314151617181920212223242526272829303132class Engineer { name: string; role: string; skills: string[]; hobbies: string[];
constructor(name: string, role: string, skills: string[], hobbies: string[]) { this.name = name; this.role = role; this.skills = skills; this.hobbies = hobbies; }
introduce(): void { console.log(`Hello! This is ${this.name}.`); console.log(`I'm usually ${this.role}`); console.log(`I can use the following stacks: ${this.skills.join(', ')}`); console.log(`My hobby is: ${this.hobbies.join(', ')}`); }}
// express myselfconst me = new Engineer( 'Wing', 'student', ['TypeScript', 'Svelte', 'SvelteKit', 'Vue', 'Nuxt', 'Astro', 'Solid.js'], ['Web Development', 'Photography', 'Cat', 'Trip']);
me.introduce();
/* I haven't written such a complex code ever! */