07.10.2026 - QuizStart with Search
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
class Student{
|
||||
constructor(firstName, lastName, age)
|
||||
{
|
||||
this.firstName = firstName;
|
||||
this.lastName = lastName;
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
greeting() {
|
||||
console.log(`Hi, my name is ${this.firstName} ${this.lastName}. I'm ${this.age} years old.`);
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
const jonny = new Student("Jonny", "Hilbert", 22);
|
||||
const lisa = new Student("Lisa", "Lauser", 41);
|
||||
|
||||
|
||||
|
||||
jonny.greeting();
|
||||
lisa.greeting();
|
||||
Reference in New Issue
Block a user