class Programmer {
#languages;
constructor(name, languages) {
this.name = name;
this.#languages = languages;
}
#knownLanguages() {
return `expert in the following languages: ${this.#languages.join(", ")}`;
}
showLanguages() {
return this.#knownLanguages();
}
}
class Simon extends Programmer {
constructor(name, languages, occupation, location) {
super(name, languages);
this.occupation = occupation;
this.location = location;
}
introduce() {
console.log(`Hi, I'm ${this.name}. I'm a ${this.occupation} living in ${this.location} and I am ${this.showLanguages()}.`);
}
codeIn(frameworks) {
console.log(`${this.name} is coding in the following frameworks: ${frameworks.join(', ')}.`);
}
}
const bbsimon = new Simon('BB Simon', ['JavaScript', 'TypeScript', 'Node.js', 'Ruby', 'Ruby on Rails', 'Express.js', 'React.js', 'Next.js'], 'Software Engineer', 'Cairo, Egypt');
bbsimon.introduce();
bbsimon.codeIn(['React.js', 'Next.js', 'Express.js', 'Rails']);
-
Notifications
You must be signed in to change notification settings - Fork 0
BB-Simon/BB-Simon
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Β | Β | |||
Repository files navigation
About
My personal repository
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published