This commit is contained in:
MishaBagger
2023-10-25 09:15:21 +03:00
commit b6c10cc93f
9828 changed files with 1446743 additions and 0 deletions

4
2/app.js Normal file
View File

@@ -0,0 +1,4 @@
const User = require('./user.js');
let eugene = new User('Eugene', 32);
eugene.sayHi();

14
2/user.js Normal file
View File

@@ -0,0 +1,14 @@
function User(name, age) {
this.name = name;
this.age = age;
this.displayInfo = function () {
console.log(
`Имя: ${this.name} Возраст: ${this.age}`
);
};
}
User.prototype.sayHi = function () {
console.log(`Привет, меня зовут ${this.name}`);
};
module.exports = User;