Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Калькулятор #4

Merged
merged 2 commits into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2-module/3-task/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

```js
let calculator = {
// ... ваш код ...

};

calculator.read(3, 5);
Expand Down
15 changes: 12 additions & 3 deletions 2-module/3-task/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
let calculator = {
// ваш код
};

let calculator = {
read(a, b) {
this.a = a;
this.b = b;
},
sum() {
return this.a + this.b;
},
mul() {
return this.a * this.b;
}
}
// НЕ УДАЛЯТЬ СТРОКУ, НУЖНА ДЛЯ ПРОВЕРКИ
window.calculator = calculator; // делает ваш калькулятор доступным глобально
12 changes: 11 additions & 1 deletion 3-module/1-task/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@

let vasya = { name: 'Вася', age: 25 };
let petya = { name: 'Петя', age: 30 };
let masha = { name: 'Маша', age: 28 };

let users = [ vasya, petya, masha ];

function namify(users) {
// ваш код...
let names = users.map(item => item.name);
return names;
}

let names = namify(users);
Loading